Skip to content

Commit fab4314

Browse files
committed
preload wasm on browser
1 parent 10de34b commit fab4314

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/workers-assets-gen/assets/runtime/browser.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const modPromise = WebAssembly.compileStreaming(fetch("./build/app.wasm"));
2+
13
export async function loadModule() {
2-
return await WebAssembly.compileStreaming(fetch("./build/app.wasm"));
4+
return await modPromise;
35
}
46

57
export function createRuntimeContext({ binding }) {

0 commit comments

Comments
 (0)