Skip to content

Commit

Permalink
fix(plugin-legacy): fix legacy plugin not working in worker context
Browse files Browse the repository at this point in the history
  • Loading branch information
sapenlei committed Dec 27, 2024
1 parent f7b1964 commit 31d327a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/plugins/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ export const buildEsbuildPlugin = (): Plugin => {
return null
}

if (chunk.name === 'worker' && opts.format === 'iife') {
options.format = 'iife'
}

const res = await transformWithEsbuild(
code,
chunk.fileName,
Expand Down

0 comments on commit 31d327a

Please sign in to comment.