Startup not triggered with multiple build inputs
dcarr45 opened this issue · 3 comments
dcarr45 commented
I may be misunderstanding the expected config, but this configuration of multiple input files that was working in 0.14.1 no longer works in 0.15.x due to #166:
{
entry: ['main.ts', 'preload.ts', 'redis.ts'],
vite: {
build: {
outDir: './dist/electron',
emptyOutDir: true,
rollupOptions: {
output: {
format: 'commonjs',
},
},
sourcemap: 'inline',
},
},
onstart(args) {
void args.startup(['./dist/electron/main.js']);
},
},
It seems that the closeBundle()
event is only fired once during vite serve
, regardless of the number of entry/input files, so this condition
if (++closeBundleCount < entryCount) return
is never met.
I'm on vite@4.5.0
caoxiemeihao commented
Hey! thanks for the tip!
GeoffreyChen777 commented
Hi, I met the same issue.
Finally I found that, in v0.15.x, we should config the plugin like:
electron([
{
entry: "app/main/main-entry.ts",
vite: {
}
},
{
entry: "app/main/second-entry.ts",
vite: {
}
}
]),
caoxiemeihao commented