Build doesn't include all required files
dakom opened this issue ยท 3 comments
๐ Bug description
The package.json manifest doesn't include NAME_bg.js and yet NAME.js has a export from "./NAME_bg.js"
line
This causes things to crash when trying to use the library
๐ค Expected Behavior
I'm not sure what the role of _bg.js
vs. just .js
is. As a temporary workaround, I guess all the files in pkg should be listed in the package.json
๐ Steps to reproduce
Follow the instructions on the wasm-pack docs
๐ Your environment
Include the relevant details of your environment.
wasm-pack version: 0.9.1
rustc version: 1.44.1
This should be fixed by #839, but that hasn't been released yet. So another workaround would be to build from the current master branch rather than the released version. If that still contains the issue, please update this
I compiled the master version to see if it fixes anything, and sure enough my _bg.js
file is included in the package, but wasm-bindgen also generates a snippets
directory with *.js
files that should be included as well..
I just hit this problem using wasm-bindgen-rayon
- the snippets
directory does not get included so the published package does not work. Why not just remove the explicit files
listing in package.json
and include everything in pkg
?