fix: in the specified non-production mode, the base path is wrong

This commit is contained in:
alex8088 2022-09-19 18:33:56 +08:00
parent 556fe95f20
commit 19bfb2a829

View file

@ -216,7 +216,8 @@ export function electronRendererVitePlugin(options?: ElectronPluginOptions): Plu
config(config): void {
const root = options?.root || process.cwd()
config.base = config.mode === 'production' ? './' : config.base
config.base =
config.mode === 'production' || process.env.NODE_ENV_ELECTRON_VITE === 'production' ? './' : config.base
config.root = config.root || './src/renderer'
const electornVer = getElectronMainVer(root)