tweaks to load wasm from node fs

This commit is contained in:
ading2210 2025-02-14 13:18:59 -05:00
parent 87b887a4b7
commit 50671f5837

View file

@ -94,9 +94,15 @@ function load_wasm(url) {
//skip this if we are running in single file mode
if (!wasmBinaryFile || !isDataURI(wasmBinaryFile)) {
wasmBinaryFile = url;
if (ENVIRONMENT_IS_NODE) {
let fs = require("node:fs");
wasmBinary = fs.readFileSync(url);
}
else {
wasmBinaryFile = url;
}
createWasm();
run();
run();
}
return new Promise((resolve, reject) => {