fix: emptyOutDir = true

This commit is contained in:
草鞋没号 2022-04-15 07:52:22 +08:00
parent c4cd89205a
commit ca56f32a3d
3 changed files with 6 additions and 3 deletions

View File

@ -6,13 +6,14 @@ export default defineConfig({
root: __dirname, root: __dirname,
build: { build: {
outDir: '../../dist/main', outDir: '../../dist/main',
emptyOutDir: true,
minify: process.env./* from mode option */NODE_ENV === 'production',
sourcemap: true,
lib: { lib: {
entry: 'index.ts', entry: 'index.ts',
formats: ['cjs'], formats: ['cjs'],
fileName: () => '[name].cjs', fileName: () => '[name].cjs',
}, },
minify: process.env./* from mode option */NODE_ENV === 'production',
sourcemap: true,
rollupOptions: { rollupOptions: {
external: [ external: [
'electron', 'electron',

View File

@ -7,6 +7,7 @@ export default defineConfig({
root: __dirname, root: __dirname,
build: { build: {
outDir: '../../dist/preload', outDir: '../../dist/preload',
emptyOutDir: true,
minify: process.env./* from mode option */NODE_ENV === 'production', minify: process.env./* from mode option */NODE_ENV === 'production',
// https://github.com/caoxiemeihao/electron-vue-vite/issues/61 // https://github.com/caoxiemeihao/electron-vue-vite/issues/61
sourcemap: 'inline', sourcemap: 'inline',

View File

@ -25,8 +25,9 @@ export default defineConfig({
], ],
base: './', base: './',
build: { build: {
sourcemap: true,
outDir: '../../dist/renderer', outDir: '../../dist/renderer',
emptyOutDir: true,
sourcemap: true,
}, },
server: { server: {
host: pkg.env.VITE_DEV_SERVER_HOST, host: pkg.env.VITE_DEV_SERVER_HOST,