This is a simple proof-of-concept showing how to use Rust to generate WASM code without requiring the use of webpack.
For more context, see this Twitter thread.
I originally wrote this a while ago, but if I recall
correctly, the key concept that allowed me to avoid the
use of webpack was the --no-modules
option to wasm-bindgen
.
You will need to rename lib.rs
to src/lib.rs
to get this
to run (I had to flatten the directory structure to make
it a gist).
Then run ./build.sh
and open index.html
in a browser using
a static file server that serves WASM files with the proper
MIME type (e.g. http-server).
You should see the text "Hello from wasm" in your console.