--auto-reload for cargo run?

  1. "cargo-web" has cargo web start --auto-reload which has the nice property that any time the code changes, it recompiles and forces browser to reload

  2. I have an application where cargo run --release runs a webserver, which I would also like to have it recompile + kill existing server + reload on source changes. Is there a way to get an --auto-reload on cargo run ?

cargo-watch is useful for this.

3 Likes

cargo watch -x 'run -- -release' seems to be precisely what I need. Thanks!

1 Like