perf: do not externalize node builtin modules for the renderer (#61)

This commit is contained in:
alex8088 2022-11-19 14:24:12 +08:00
parent e72e1ea056
commit 067c333aeb

View file

@ -251,8 +251,7 @@ export function electronRendererVitePlugin(options?: ElectronPluginOptions): Plu
target: chromeTarget, target: chromeTarget,
modulePreload: { polyfill: false }, modulePreload: { polyfill: false },
rollupOptions: { rollupOptions: {
input: findInput(root), input: findInput(root)
external: [...builtinModules.flatMap(m => [m, `node:${m}`])]
}, },
reportCompressedSize: false, reportCompressedSize: false,
minify: false, minify: false,