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,7 +94,13 @@ function load_wasm(url) {
//skip this if we are running in single file mode //skip this if we are running in single file mode
if (!wasmBinaryFile || !isDataURI(wasmBinaryFile)) { if (!wasmBinaryFile || !isDataURI(wasmBinaryFile)) {
wasmBinaryFile = url; if (ENVIRONMENT_IS_NODE) {
let fs = require("node:fs");
wasmBinary = fs.readFileSync(url);
}
else {
wasmBinaryFile = url;
}
createWasm(); createWasm();
run(); run();
} }