diff --git a/src/cli.ts b/src/cli.ts index e8ef4c7..b745c01 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -131,6 +131,7 @@ cli.command('build [root]', 'build for production').action(async (root: string, try { await build(inlineConfig) + process.exit(0) } catch (e) { const error = e as Error createLogger(options.logLevel).error(colors.red(`error during build:\n${error.stack}`), { error }) diff --git a/src/plugins/electron.ts b/src/plugins/electron.ts index 1ac861c..2a29211 100644 --- a/src/plugins/electron.ts +++ b/src/plugins/electron.ts @@ -342,8 +342,7 @@ export function electronRendererVitePlugin(options?: ElectronPluginOptions): Plu config(config): void { const root = options?.root || process.cwd() - config.base = - config.mode === 'production' || process.env.NODE_ENV_ELECTRON_VITE === 'production' ? './' : config.base + config.base = config.base ?? './' config.root = config.root || './src/renderer' const chromeTarget = getElectronChromeTarget()