Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ export const nodePolyfills = (options: PolyfillOptions = {}): Plugin => {
: {},
},
},
esbuild: {
// In dev, the global polyfills need to be injected as a banner in order for isolated scripts (such as Vue SFCs) to have access to them.
banner: isDev ? globalShimsBanner : undefined,
},
// Vite 8+ (Rolldown) replaces esbuild with oxc for JS transforms
...(isRolldownVite
? { oxc: { jsxInject: isDev ? globalShimsBanner : undefined } }
: { esbuild: { banner: isDev ? globalShimsBanner : undefined } }
),
optimizeDeps: {
exclude: [
...globalShimPaths,
Expand Down