Skip to the content.

RustでWebAssembly

プロジェクトの構築手順

  1. nvmのインストール
  2. nvm install --ltsnpmのインストール
  3. cargo install cargo-generate
  4. cargo generate --git https://github.com/rustwasm/wasm-pack-template
  5. curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
  6. cd <project name>でプロジェクトに移動し,wasm-pack buildでビルド
  7. npm init wasm-app www

プロジェクトの実行

wasm-pack build
cd www
npm run start

参考

実践Rustプログラミング入門