From 0f1fa16229ef206dc7700294f56c3232ef0ff294 Mon Sep 17 00:00:00 2001 From: velzie Date: Sun, 13 Oct 2024 13:42:09 -0400 Subject: [PATCH] fix: add config back to workers --- src/shared/rewriters/worker.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/shared/rewriters/worker.ts b/src/shared/rewriters/worker.ts index ec20fad..97094e0 100644 --- a/src/shared/rewriters/worker.ts +++ b/src/shared/rewriters/worker.ts @@ -10,13 +10,19 @@ export function rewriteWorkers( ) { let str = ""; - for (const script of clientscripts) { + let script = (script) => { if (type === "module") { str += `import "${$scramjet.config.files[script]}"\n`; } else { str += `importScripts("${$scramjet.config.files[script]}");\n`; } - } + }; + + script("wasm"); + script("shared"); + str += `self.$scramjet.config = ${JSON.stringify($scramjet.config)};`; + script("client"); + console.log(str); let rewritten = rewriteJs(js, meta); if (rewritten instanceof Uint8Array) {