Suggest adding wasm32-unknown-unknown to cargo config on Linux
Discussed in https://github.com/DioxusLabs/dioxus/discussions/947
Originally posted by pickfire April 9, 2023
I noticed if I did not specify wasm32-unknown-unknown and I use dioxus serve --hot-reload with rust-analyzer running in the terminal, it needs a full build every time and the incremental build is very slow.
But if I add the wasm target to cargo config in .cargo/config, then it became very fast even on non-rsx changes (from ~48s to ~2.5s). Maybe because there are some issues with caching for rust-analyzer?
[build]
target = "wasm32-unknown-unknown"
Maybe we can suggest adding that to https://dioxuslabs.com/docs/0.3/guide/en/getting_started/hot_reload.html if web is used?
This issue does not effect windows or mac, but there have been other reports of the same issue on discord about hot reloading doing a full rebuild on linux with rust analyzer
We should change rust-analyzer.cargo.target, not the default target for cargo so that we don't break cargo run for any cross platform apps
We could try to insert it into the config in https://github.com/rust-lang/rust-analyzer/issues/13529