do some more worker rewriting

This commit is contained in:
Percs 2024-07-13 21:00:54 -05:00
parent a25e71a6fd
commit 4ce4226afa
4 changed files with 33 additions and 2 deletions

View 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;
}