Wasm32, source maps, firefox dev edition, cargo web

#1
  1. Using --target=wasm32-unknown-emscripten, -s WASM=1, and firefox developer edition it is possible to get source maps

  2. When I run “cargo web --target=wasm32-unknown-emscripten” I am not seeing source maps. Is there a wa yto tell cargo web to use “-s WASM=1” ?

#2

(Been since before Firefox nightly release I last read about source maps.)
Source maps are now even enabled in the regular release of Firefox.

For wasm32-unknown-unknown: wasm-sourcemap.py looks like the way to generate them. (Not looked/found where to get the script.)
This demo with source

From what I gather it used to be emscripten many months ago so maybe the github history can answer your question.

#3

I believe this is the script: wasm-sourcemap.py. It’s inside the emscripten repo.

Also, I think the README in that rust-wasm-hey repo is out-of-date/not complete. The Makefile has the full command with all of the additional parameters to wasm-sourcemap.py. Though, I haven’t gotten it to work myself.

I’m a bit disappointed that there isn’t a great solution to this yet. It would make developing web apps in rust much more viable.