Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ playground/html/invalid.html
playground/html/valid.html
playground/external/public/[email protected]
playground/ssr-html/public/[email protected]
playground/worker/classic-worker.js
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
}
if (injectEnv) {
const s = new MagicString(raw)
s.prepend(injectEnv)
s.prepend(injectEnv + ';\n')
return {
code: s.toString(),
map: s.generateMap({ hires: 'boundary' }),
Expand Down
2 changes: 2 additions & 0 deletions playground/worker/classic-worker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(() => {})() // this is to test `importScripts` injection doesn't break the code

let base = `/${self.location.pathname.split('/')[1]}`
if (base.endsWith('.js') || base === `/worker-entries`) base = '' // for dev

Expand Down