feat: define env prefix

This commit is contained in:
alex8088 2022-08-20 20:33:14 +08:00
parent 5dc1ddc6ad
commit 7a60cce781

View File

@ -71,6 +71,8 @@ export function electronMainVitePlugin(options?: ElectronPluginOptions): Plugin[
config.define = config.define || {}
config.define = { ...processEnvDefine(), ...config.define }
config.envPrefix = config.envPrefix || 'MAIN_VITE_'
}
},
{
@ -150,6 +152,8 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug
config.define = config.define || {}
config.define = { ...processEnvDefine(), ...config.define }
config.envPrefix = config.envPrefix || 'PRELOAD_VITE_'
}
},
{
@ -240,6 +244,8 @@ export function electronRendererVitePlugin(options?: ElectronPluginOptions): Plu
config.build = buildConfig
config.envDir = config.envDir || path.resolve(root)
config.envPrefix = config.envPrefix || 'RENDERER_VITE_'
}
},
{