updated worker.mjs and shim.mjs

This commit is contained in:
syumai 2023-04-29 18:21:45 +09:00
parent a310604cc9
commit dc5d872e1c
2 changed files with 9 additions and 1 deletions

View File

@ -1,9 +1,14 @@
import "./polyfill_performance.js"; import "./polyfill_performance.js";
import "./wasm_exec.js"; import "./wasm_exec.js";
import mod from "./app.wasm";
const go = new Go(); const go = new Go();
let mod;
export function init(m) {
mod = m;
}
async function run() { async function run() {
const readyPromise = new Promise((resolve) => { const readyPromise = new Promise((resolve) => {
globalThis.ready = resolve; globalThis.ready = resolve;

View File

@ -1,3 +1,6 @@
import * as imports from "./shim.mjs"; import * as imports from "./shim.mjs";
import mod from "./app.wasm";
imports.init(mod);
export default { fetch: imports.fetch } export default { fetch: imports.fetch }