mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
do some more worker rewriting
This commit is contained in:
parent
a25e71a6fd
commit
4ce4226afa
4 changed files with 33 additions and 2 deletions
11
src/shared/rewriters/worker.ts
Normal file
11
src/shared/rewriters/worker.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { rewriteJs } from "./js";
|
||||
export function rewriteWorkers(js: string, origin?: URL) {
|
||||
let str = new String().toString()
|
||||
//@ts-expect-error
|
||||
["codecs", "config", "shared", "client"].forEach((script) => {
|
||||
str += `import "${self.__scramjet$config[script]}"\n`
|
||||
})
|
||||
str += rewriteJs(js, origin);
|
||||
|
||||
return str;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue