4 ms·
It's a pleasant suprise how easy targeting wasm is from Rust. Just pass on the right `--target` flag to `cargo build` if you have the toolchain installed.
by TazeTSchnitzel 7y ago
It's a pleasant suprise how easy targeting wasm is from Rust. Just pass on the right `--target` flag to `cargo build` if you have the toolchain installed.
- MaulingMonkey 7y agoAnd installing the right target is typically as simple as: rustup target add wasm32-unknown-unknown Targeting browser APIs is a little more involved, generally requiring either: cargo install cargo-web cargo web build [...] for stdweb, or for web-sys: cargo install wasm-pack wasm-pack build [...]
- johnisgood 7y agoIn all fairness, `GOARCH=wasm GOOS=js go build` is just as easy.