From 1b9858a2985bf02f2db53fa8d4b0762a14e0c395 Mon Sep 17 00:00:00 2001 From: hemengke <23536175@qq.com> Date: Sat, 25 May 2024 18:37:09 +0800 Subject: [PATCH] fix: windows path fix --- src/node/processor/FileCacheProcessor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/processor/FileCacheProcessor.ts b/src/node/processor/FileCacheProcessor.ts index 090c065..ea53b43 100644 --- a/src/node/processor/FileCacheProcessor.ts +++ b/src/node/processor/FileCacheProcessor.ts @@ -2,6 +2,7 @@ import createDebug from 'debug' import fs from 'fs-extra' import path from 'node:path' import colors from 'picocolors' +import { normalizePath } from 'vite' import { globalConfig } from '../global-config' import { writeFile } from '../helper/io' import { findAllOldJsFile, pkgName } from '../helper/utils' @@ -64,7 +65,7 @@ export class FileCacheProcessor extends ManifestCacheProcessor { const jsFilePath = this.setCache(args, globalConfig.all) - fs.ensureDirSync(path.dirname(jsFilePath)) + fs.ensureDirSync(normalizePath(path.dirname(jsFilePath))) writeFile(jsFilePath, code) }