mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-13 23:56:06 +00:00
Merge pull request #117 from markandrus/fix-require-from-different-directory
Call fs.readFileSync with __dirname
This commit is contained in:
commit
db15a898cb
@ -148,7 +148,8 @@ impl Bindgen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
shim.push_str(&format!("
|
shim.push_str(&format!("
|
||||||
const bytes = require('fs').readFileSync('{}');
|
const join = require('path').join;
|
||||||
|
const bytes = require('fs').readFileSync(join(__dirname, '{}'));
|
||||||
const wasmModule = new WebAssembly.Module(bytes);
|
const wasmModule = new WebAssembly.Module(bytes);
|
||||||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||||
module.exports = wasmInstance.exports;
|
module.exports = wasmInstance.exports;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user