Skip to content

Commit

Permalink
fix: use nodeLikeBuiltins for ssr.target: 'webworker' without `no…
Browse files Browse the repository at this point in the history
…External: true` (#19313)
  • Loading branch information
sapphi-red authored Feb 3, 2025
1 parent b7aba0b commit 9fc31b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,10 @@ function resolveEnvironmentResolveOptions(
: DEFAULT_SERVER_CONDITIONS.filter((c) => c !== 'browser'),
builtins:
resolve?.builtins ??
(consumer === 'server' && !isSsrTargetWebworkerEnvironment
? nodeLikeBuiltins
(consumer === 'server'
? isSsrTargetWebworkerEnvironment && resolve?.noExternal === true
? []
: nodeLikeBuiltins
: []),
},
resolve ?? {},
Expand Down

0 comments on commit 9fc31b6

Please sign in to comment.