From c40de5d3b2ed08f01e95290e07475eef2ab50e75 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Wed, 18 Dec 2024 13:24:35 +0800 Subject: [PATCH] build: vite.config.ts --- ui/vite.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vite.config.ts b/ui/vite.config.ts index be526655..2297d5d1 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -12,7 +12,7 @@ const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => { // 在构建开始时将要保留的文件或目录移动到临时位置 filesToPreserve.forEach((file) => { const srcPath = path.resolve(__dirname, file); - const tempPath = path.resolve(__dirname, `temp_${file}`); + const tempPath = path.resolve(__dirname, `node_modules`, `.tmp`, `build_${file}`); if (fs.existsSync(srcPath)) { fs.moveSync(srcPath, tempPath, { overwrite: true }); } @@ -22,7 +22,7 @@ const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => { // 在构建完成后将临时位置的文件或目录移回原来的位置 filesToPreserve.forEach((file) => { const srcPath = path.resolve(__dirname, file); - const tempPath = path.resolve(__dirname, `temp_${file}`); + const tempPath = path.resolve(__dirname, `node_modules`, `.tmp`, `build_${file}`); if (fs.existsSync(tempPath)) { fs.moveSync(tempPath, srcPath, { overwrite: true }); }