We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 090b7b2 + c3cf34b commit 5105f11Copy full SHA for 5105f11
runtime/wasm/runtime.js
@@ -471,9 +471,9 @@
471
const f = path.join(path.dirname(require.main.filename), src);
472
return require("node:fs/promises").readFile(f);
473
}
474
+ const fetchBase = globalThis?.document?.currentScript?.src;
475
function fetchRelative(src) {
- const base = globalThis?.document?.currentScript?.src;
476
- const url = base ? new URL(src, base) : src;
+ const url = fetchBase ? new URL(src, fetchBase) : src;
477
return fetch(url);
478
479
const loadCode = isNode ? loadRelative : fetchRelative;
0 commit comments