Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
XiSenao committed Dec 12, 2023
1 parent ab55667 commit 65d033d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ export function webWorkerPostPlugin(): Plugin {
resolveImportMeta(property, { chunkId, format }) {
// document is undefined in the worker, so we need to avoid it in iife
if (format === 'iife') {
// Transpiling import.meta
if (!property) {
return `{
url: self.location.href
}`
}
// Transpiling import.meta.url
if (property === 'url') {
return 'self.location.href'
}
Expand Down

0 comments on commit 65d033d

Please sign in to comment.