fix: wasm loading
This commit is contained in:
parent
1c738c8aae
commit
a530a07f01
|
@ -5,12 +5,12 @@ export default async function (imports) {
|
|||
|
||||
// @ts-ignore
|
||||
const wasmPath = new URL("wasm/bao.wasm", import.meta.url);
|
||||
|
||||
const wasm = await fs.readFile(wasmPath);
|
||||
|
||||
return WebAssembly.instantiate(wasm, imports);
|
||||
return (await WebAssembly.instantiate(wasm, imports)).instance;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
return await import("./wasm/bao.wasm");
|
||||
let wasm = await import("./wasm/bao.wasm");
|
||||
wasm = wasm.default || wasm;
|
||||
return (await wasm(imports)).instance;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue