Skip to content

Files

Latest commit

72a8c1d · Jul 26, 2020

History

History

mdn-hello-wasm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 26, 2020
Jul 26, 2020
Jul 26, 2020
Jul 26, 2020
Jul 26, 2020

README.md

hello-wasm in MDN

Rust 側

  • extern の中に、「Rust 内で使いたい JS の関数のシグネチャ」を書く
  • 「JS 側で使いたい Rust で書いた関数」は pub fn xxx で宣言
  • ↑どちらも #[wasm_bindgen] が必要

ビルド

$ wasm-pack build --scope zaki-yama

$ tree pkg
pkg
├── hello_wasm.d.ts
├── hello_wasm.js
├── hello_wasm_bg.d.ts
├── hello_wasm_bg.js
├── hello_wasm_bg.wasm
└── package.json

トラブルシューティング