fix: configure build options

This commit is contained in:
younglei 2022-06-14 21:17:45 +08:00
parent e2798e025d
commit f41ddead18

View File

@ -12,12 +12,23 @@ export default defineConfig({
electron({ electron({
main: { main: {
entry: 'electron-main/index.ts', entry: 'electron-main/index.ts',
vite: {
build: {
sourcemap: false,
},
},
}, },
preload: { preload: {
input: { input: {
// You can configure multiple preload here // You can configure multiple preload here
p1: join(__dirname, 'electron-preload'), splash: join(__dirname, 'electron-preload/splash.ts'),
}, },
vite: {
build: {
// For debug
sourcemap: 'inline',
}
}
}, },
}), }),
// Enable use Electron, Node.js API in Renderer-process // Enable use Electron, Node.js API in Renderer-process
@ -25,4 +36,8 @@ export default defineConfig({
// TODO: integrate into 'vite-plugin-electron' by default // TODO: integrate into 'vite-plugin-electron' by default
polyfillExports(), polyfillExports(),
], ],
build: {
// TODO: integrate into 'vite-plugin-electron' by default
emptyOutDir: false,
},
}) })