I'm using trunk serve in my rust project in Windows, everything goes great and compiles and serves, but if I save the file, it doesn't automactly re-compile and serve.
I was expecting it to when I save any of the rust file it to compile and serve, I did trunk serve and tried trunk serve --watch (filepath).
Any fix?
some times native method fails, and theres an alternative approach to do it, and if it was written than there where a purpose to do it.
Install Rust and Cargo
install using Cargo(Binstall):
https://crates.io/crates/cargo-watch
cargo install cargo-watch
recompile when changes are detected:
cargo watch -x run
rebuild without running:
cargo watch -x build
ignore changes in a directory:
cargo watch -x run --ignore "directory u want to ignore/*"
to set up a server u can do this:
add warp to your
Cargo.toml
:than in
src/main.rs
, set up a simple HTTP server:and than use this: