mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-07 05:31:37 +03: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!("
|
||||
const bytes = require('fs').readFileSync('{}');
|
||||
const join = require('path').join;
|
||||
const bytes = require('fs').readFileSync(join(__dirname, '{}'));
|
||||
const wasmModule = new WebAssembly.Module(bytes);
|
||||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
module.exports = wasmInstance.exports;
|
||||
|
Loading…
Reference in New Issue
Block a user