UNPKG

musashi-wasm

Version:

M68k Musashi WebAssembly (default and Perfetto profiling builds)

11 lines (9 loc) 483 B
import { fileURLToPath } from "url"; import createModule from "./dist/musashi-perfetto-loader.mjs"; export default function init(options = {}) { const isNode = typeof process !== "undefined" && !!process.versions?.node; const wasmUrl = new URL("./dist/musashi-perfetto.wasm", import.meta.url); const wasmPath = isNode ? fileURLToPath(wasmUrl) : wasmUrl.href; const locateFile = (p) => p.endsWith(".wasm") ? wasmPath : p; return createModule({ locateFile, ...options }); }