Probably, you already installed. But if you do not install yet, please see here.
wasm-pack
You can install wasm-pack by this command:
cargoinstallwasm-pack
Node.js and npm
You can get from here. If you want not to use npm but also to use yarn and so on, you can use it.
File Setting
You can create a cargo project by this command:
cargonew--libcrate-name
and create some files like this:
[root of crate]
.gitignore
Cargo.toml
package.json
webpack.config.js
[src]
lib.js
[template]
index.html
index.js
.gitignore
/target
/node_modules
/pkg
cargo.toml
[package]name ="hello-world"version ="0.1.0"edition="2021"[lib]crate-type = ["cdylib","rlib"][dependencies]js-sys="^0.3"kagura="^0.14"nusa="^0.1"wasm-bindgen="^0.2"wasm-bindgen-futures ="^0.4"[dependencies.web-sys]version="^0.3"features=[# If you want to use HtmlCanvasElement, Blob, IdbDatabase and so on, # add features hear.]