How to build WASM from Rust?
Following MDN's WASM tutorial I've built a wasm that runs in the browser.
Importing the generated
wasm.js
works fine, when I try to import the wasm_bg.wasm
directly, it throws this error.
Not really understanding how bindgen works, but how do I build a Deno compatible WASM from Rust
2 Replies
I'm pretty sure the
wasm.js
file is meant to handle importing and setting up the wasm_bg.wasm
file and creating the functions to interact with it.That's what bindgen does, I am just curious the best way to compile Rust into a WASM for Deno's newly supported direct import.