cargo-web
cargo-web copied to clipboard
Support custom wasm paths
The generated wasm loader will only load wasm files relative to the html page. This is a problem if the wasm file is in a static directory (mysite.app/static_path/awesome.wasm
), served by a third party framework. Currently i have to manually adjust the path to prepend '/static_path/' in the generated file here.
I'd propose to make this path configurable in Web.toml
.
This might also solve some problems I've had with Chrome Extensions, so this gets a big :+1: from me.
This was something I did plan to add, but not WASM-specific - you'd set the path in your Web.toml
to where your .js
file would be generated (e.g. with cargo deploy
) and served from with the implication that the .wasm
file would be right next to it on non-asmjs targets.
Would that work for you?
If you mean that the wasm file will be loaded from the same absolute path, then yes!