Skip to content

Commit

Permalink
fix: electorn's export subpaths also need to be externalized #372
Browse files Browse the repository at this point in the history
  • Loading branch information
alex8088 committed Jan 6, 2024
1 parent 921aa9d commit a12646f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function electronMainVitePlugin(options?: ElectronPluginOptions): Plugin[
target: nodeTarget,
assetsDir: 'chunks',
rollupOptions: {
external: ['electron', ...builtinModules.flatMap(m => [m, `node:${m}`])],
external: ['electron', /^electron\/.+/, ...builtinModules.flatMap(m => [m, `node:${m}`])],
output: {}
},
reportCompressedSize: false,
Expand Down Expand Up @@ -203,7 +203,7 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug
target: nodeTarget,
assetsDir: 'chunks',
rollupOptions: {
external: ['electron', ...builtinModules.flatMap(m => [m, `node:${m}`])],
external: ['electron', /^electron\/.+/, ...builtinModules.flatMap(m => [m, `node:${m}`])],
output: {}
},
reportCompressedSize: false,
Expand Down

0 comments on commit a12646f

Please sign in to comment.