Preparation

preparation to creat and view a web page.

Nessesary Tools

cargo

Probably, you already installed. But if you do not install yet, please see herearrow-up-right.

wasm-pack

You can install wasm-pack by this command:

cargo install wasm-pack

Node.js and npm

You can get from herearrow-up-right. 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:

cargo new --lib crate-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

Install Pacakges

Last updated