Skip to content
Márk Tolmács edited this page Jun 25, 2023 · 3 revisions

Welcome to the wasm2map wiki!

Development

Set up a development environment

  1. Install the wasm32-unknown-unknown target, which is required for the tests to run:
rustup target add wasm32-unknown-unknown [--target nightly]

Further speedup tips

  1. Strip the WASM file from DWARF debug symbols if you generated a sourcemap file and will not use the embedded DWARF data. You can use the wasm-strip tool from WebAssembly Binary Toolkit (wabt):
wasm-strip /target/wasm32-unknown-unknown/<debug|release>/<projectname>.wasm

Note: wasm2map does not do this automatically, because Google Chore is working on directly reading DWARF data from WASM, so to support all platforms, you might want to keep it.

Alternatively, you might want to keep the DWARF symbols in a separate file.

Code coverage on local

  1. Install the cargo command llvm-cov:
cargo install cargo-llvm-cov 
  1. Run text report:
cargo llvm-cov
  1. Integrate with IDE: Note: VSCode has 'Coverage Gutters' extension which can read it.
cargo llvm-cov --lcov --output-path lcov.info