diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index 0060fd925..271bd6fd5 100644 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -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;