Y
Hacker News
new
|
ask
|
show
|
jobs
by
grose
846 days ago
What's the best way to include a binary blob (wasm binary) in your package? For NPM I've been using a bundler (esbuild's `binary` loader) but I'm not sure of the best way to do that in a modern, jsr-friendly way.
2 comments
lucacasonato
846 days ago
We will soon support WASM imports (`import source foo from "./foo.wasm"`). [1]
[1]:
https://github.com/tc39/proposal-source-phase-imports
link
grose
846 days ago
Excellent, this will make my life easier. Thanks!
link
alex_suzuki
846 days ago
If you‘re using emscripten, check out the SINGLE_FILE option, that embeds the WASM as a base64-encoded string into the JS.
link
[1]: https://github.com/tc39/proposal-source-phase-imports