From ca56f32a3ddf5f8b90f236c45c0a21e4453429db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Fri, 15 Apr 2022 07:52:22 +0800 Subject: [PATCH] fix: emptyOutDir = true --- packages/main/vite.config.ts | 5 +++-- packages/preload/vite.config.ts | 1 + packages/renderer/vite.config.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/main/vite.config.ts b/packages/main/vite.config.ts index 7d60031..cd7928b 100644 --- a/packages/main/vite.config.ts +++ b/packages/main/vite.config.ts @@ -6,13 +6,14 @@ export default defineConfig({ root: __dirname, build: { outDir: '../../dist/main', + emptyOutDir: true, + minify: process.env./* from mode option */NODE_ENV === 'production', + sourcemap: true, lib: { entry: 'index.ts', formats: ['cjs'], fileName: () => '[name].cjs', }, - minify: process.env./* from mode option */NODE_ENV === 'production', - sourcemap: true, rollupOptions: { external: [ 'electron', diff --git a/packages/preload/vite.config.ts b/packages/preload/vite.config.ts index f63dab6..550000d 100644 --- a/packages/preload/vite.config.ts +++ b/packages/preload/vite.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ root: __dirname, build: { outDir: '../../dist/preload', + emptyOutDir: true, minify: process.env./* from mode option */NODE_ENV === 'production', // https://github.com/caoxiemeihao/electron-vue-vite/issues/61 sourcemap: 'inline', diff --git a/packages/renderer/vite.config.ts b/packages/renderer/vite.config.ts index 1a8e7e6..f044137 100644 --- a/packages/renderer/vite.config.ts +++ b/packages/renderer/vite.config.ts @@ -25,8 +25,9 @@ export default defineConfig({ ], base: './', build: { - sourcemap: true, outDir: '../../dist/renderer', + emptyOutDir: true, + sourcemap: true, }, server: { host: pkg.env.VITE_DEV_SERVER_HOST,