Skip to content

Commit 4d3d0bc

Browse files
committed
fix(worker): match worker import meta more quickly
1 parent 453f1a2 commit 4d3d0bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vite/src/node/plugins/workerImportMetaUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ async function getWorkerType(
182182
}
183183

184184
const workerImportMetaUrlRE =
185-
/new\s+(?:Worker|SharedWorker).+new\s+URL.+import\.meta\.url/s
185+
/new\s+(?:Worker|SharedWorker)\s*\(\s*new\s+URL.+?import\.meta\.url/s
186186

187187
export function workerImportMetaUrlPlugin(config: ResolvedConfig): Plugin {
188188
const isBuild = config.command === 'build'

0 commit comments

Comments
 (0)