Closed anthumchris closed 6 years ago
@zandaqo Have you dealt with this before? I came across https://github.com/kripken/emscripten/issues/5342
@AnthumChris Indeed I have, it was a year ago and I chose to bundle my wasm and js into a single file with emcc — bind -std=c++14 src/wasm.cpp -s WASM=1 -O3 -o wasm.js
, as done here: https://github.com/zandaqo/iswasmfast
But iswasmfast
wasn't meant as a package, so I'd prefer locateFile
in this case.
I published this repo as an NPM package to https://www.npmjs.com/package/opus-stream-decoder.
An error occurs when trying to use
opus-stream-decoder
after the NPM package is installed.One possible solution is to build with
emcc --pre-js
and declare functionModule['locateFile']
that would return a valid path that Emscripten would use for thereadFileSync()
call.