'wasm-bindgen' manually

I am aware of: Hello, World! - The `wasm-bindgen` Guide

Is there a simple way to do this without the usage of package.json and webpack.config.js ?

The idea being:

  1. After we compile the result module, we get my_crate.wasm.js

  2. We have to at some point do something like:

import("my_crate.wasm.js").then(wasm => wasm.run());
  1. Is it possible to construct all the js manually? (This is for educational purposes, I want to understand the process of how the *.wasm file interacts with the rest of index.html / js).

Have a look at Cliff Biffle's article on "Making really tiny WebAssembly graphics demos" : Making really tiny WebAssembly graphics demos - Cliffle He goes through the entire process of compiling and using web assembly in the browser manually.

1 Like