mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-12 22:10:01 -04:00
fix
This commit is contained in:
parent
0995fea192
commit
fc948fa394
2 changed files with 4 additions and 5 deletions
|
@ -29,7 +29,7 @@ function rewriteJsWasm(
|
||||||
source: string | null,
|
source: string | null,
|
||||||
meta: URLMeta,
|
meta: URLMeta,
|
||||||
module: boolean
|
module: boolean
|
||||||
): { js: string | ArrayBuffer; map: Uint8Array | null; tag: string } {
|
): { js: string | Uint8Array; map: Uint8Array | null; tag: string } {
|
||||||
initSync({
|
initSync({
|
||||||
module: new WebAssembly.Module(self.REAL_WASM),
|
module: new WebAssembly.Module(self.REAL_WASM),
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
import { BareResponseFetch } from "@mercuryworkshop/bare-mux";
|
import { BareResponseFetch } from "@mercuryworkshop/bare-mux";
|
||||||
import { MessageW2C, ScramjetServiceWorker } from ".";
|
import { ScramjetServiceWorker } from ".";
|
||||||
import { renderError } from "./error";
|
import { renderError } from "./error";
|
||||||
import { FakeServiceWorker } from "./fakesw";
|
import { FakeServiceWorker } from "./fakesw";
|
||||||
import { CookieStore } from "../shared/cookie";
|
import { CookieStore } from "../shared/cookie";
|
||||||
import {
|
import {
|
||||||
ScramjetHeaders,
|
ScramjetHeaders,
|
||||||
unrewriteUrl,
|
unrewriteUrl,
|
||||||
rewriteUrl,
|
|
||||||
rewriteCss,
|
rewriteCss,
|
||||||
rewriteHeaders,
|
rewriteHeaders,
|
||||||
rewriteHtml,
|
rewriteHtml,
|
||||||
rewriteJs,
|
|
||||||
rewriteWorkers,
|
rewriteWorkers,
|
||||||
unrewriteBlob,
|
unrewriteBlob,
|
||||||
} from "../shared";
|
} from "../shared";
|
||||||
|
@ -368,9 +366,10 @@ async function rewriteBody(
|
||||||
workertype === "module"
|
workertype === "module"
|
||||||
);
|
);
|
||||||
if (flagEnabled("sourcemaps", meta.base) && map) {
|
if (flagEnabled("sourcemaps", meta.base) && map) {
|
||||||
|
console.log(js);
|
||||||
js =
|
js =
|
||||||
`${globalThis.$scramjet.config.globals.pushsourcemapfn}([${map.join(",")}], "${tag}");` +
|
`${globalThis.$scramjet.config.globals.pushsourcemapfn}([${map.join(",")}], "${tag}");` +
|
||||||
js;
|
(js instanceof Uint8Array ? new TextDecoder().decode(js) : js);
|
||||||
}
|
}
|
||||||
return js;
|
return js;
|
||||||
case "style":
|
case "style":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue