mirror of
https://github.com/LukeHagar/electron-vite.git
synced 2025-12-10 12:27:44 +00:00
perf: alway disable build.modulePreload in main and preload config
This commit is contained in:
@@ -91,6 +91,8 @@ export function electronMainVitePlugin(options?: ElectronPluginOptions): Plugin[
|
||||
config.publicDir = config.publicDir || 'resources'
|
||||
// do not copy public dir
|
||||
config.build.copyPublicDir = false
|
||||
// module preload polyfill does not apply to nodejs (main process)
|
||||
config.build.modulePreload = false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -191,6 +193,8 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug
|
||||
config.publicDir = config.publicDir || 'resources'
|
||||
// do not copy public dir
|
||||
config.build.copyPublicDir = false
|
||||
// module preload polyfill does not apply to nodejs (preload scripts)
|
||||
config.build.modulePreload = false
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user