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

We will soon support WASM imports (`import source foo from "./foo.wasm"`). [1]

[1]: https://github.com/tc39/proposal-source-phase-imports

Excellent, this will make my life easier. Thanks!
If you‘re using emscripten, check out the SINGLE_FILE option, that embeds the WASM as a base64-encoded string into the JS.