We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4758d1 commit df6f32fCopy full SHA for df6f32f
packages/vite/src/node/plugins/worker.ts
@@ -274,9 +274,15 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
274
injectEnv = module?.transformResult?.code || ''
275
}
276
277
- return {
278
- code: injectEnv + raw,
+ if (injectEnv) {
+ const s = new MagicString(raw)
279
+ s.prepend(injectEnv)
280
+ return {
281
+ code: s.toString(),
282
+ map: s.generateMap({ hires: 'boundary' }),
283
+ }
284
285
+ return
286
287
if (
288
query == null ||
0 commit comments