fix: electorn's export subpaths also need to be externalized #372
This commit is contained in:
parent
921aa9d4a7
commit
a12646f25e
|
@ -76,7 +76,7 @@ export function electronMainVitePlugin(options?: ElectronPluginOptions): Plugin[
|
||||||
target: nodeTarget,
|
target: nodeTarget,
|
||||||
assetsDir: 'chunks',
|
assetsDir: 'chunks',
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['electron', ...builtinModules.flatMap(m => [m, `node:${m}`])],
|
external: ['electron', /^electron\/.+/, ...builtinModules.flatMap(m => [m, `node:${m}`])],
|
||||||
output: {}
|
output: {}
|
||||||
},
|
},
|
||||||
reportCompressedSize: false,
|
reportCompressedSize: false,
|
||||||
|
@ -203,7 +203,7 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug
|
||||||
target: nodeTarget,
|
target: nodeTarget,
|
||||||
assetsDir: 'chunks',
|
assetsDir: 'chunks',
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['electron', ...builtinModules.flatMap(m => [m, `node:${m}`])],
|
external: ['electron', /^electron\/.+/, ...builtinModules.flatMap(m => [m, `node:${m}`])],
|
||||||
output: {}
|
output: {}
|
||||||
},
|
},
|
||||||
reportCompressedSize: false,
|
reportCompressedSize: false,
|
||||||
|
|
Loading…
Reference in a new issue