Capture workers with multiple words

This commit is contained in:
Dustin Brett
2025-03-15 09:18:49 -07:00
parent 484f840b37
commit cb4ab0ecdf

View File

@@ -15,7 +15,7 @@ const JS_MINIFIER_CONFIG = {
};
const workerRegEx =
/new Worker\(\w+\.\w+\(new URL\(\w+\.\w+\+\w+\.\w+\(\d+\),\w+\.\w+\)\),\{name:"(\w+)"\}\)/;
/new Worker\(\w+\.\w+\(new URL\(\w+\.\w+\+\w+\.\w+\(\d+\),\w+\.\w+\)\),\{name:"(.+)"\}\)/;
const inlineIndexWorkers = (code) => {
const [, workerName] = code.match(workerRegEx) || [];