This commit is contained in:
Toshit Chawda 2025-03-06 20:53:11 -08:00
parent 0995fea192
commit fc948fa394
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
2 changed files with 4 additions and 5 deletions

View file

@ -29,7 +29,7 @@ function rewriteJsWasm(
source: string | null,
meta: URLMeta,
module: boolean
): { js: string | ArrayBuffer; map: Uint8Array | null; tag: string } {
): { js: string | Uint8Array; map: Uint8Array | null; tag: string } {
initSync({
module: new WebAssembly.Module(self.REAL_WASM),
});

View file

@ -1,16 +1,14 @@
import { BareResponseFetch } from "@mercuryworkshop/bare-mux";
import { MessageW2C, ScramjetServiceWorker } from ".";
import { ScramjetServiceWorker } from ".";
import { renderError } from "./error";
import { FakeServiceWorker } from "./fakesw";
import { CookieStore } from "../shared/cookie";
import {
ScramjetHeaders,
unrewriteUrl,
rewriteUrl,
rewriteCss,
rewriteHeaders,
rewriteHtml,
rewriteJs,
rewriteWorkers,
unrewriteBlob,
} from "../shared";
@ -368,9 +366,10 @@ async function rewriteBody(
workertype === "module"
);
if (flagEnabled("sourcemaps", meta.base) && map) {
console.log(js);
js =
`${globalThis.$scramjet.config.globals.pushsourcemapfn}([${map.join(",")}], "${tag}");` +
js;
(js instanceof Uint8Array ? new TextDecoder().decode(js) : js);
}
return js;
case "style":