mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
11 lines
No EOL
358 B
TypeScript
11 lines
No EOL
358 B
TypeScript
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;
|
|
} |