Is there something like nodemon in Rust?

Viewed 601

In javascript nodemon is a static files server that reloads on code changes. I am using wasm-pack and miniserve to do two commands:

build

wasm-pack build --target web --out-name wasm --out-dir ./static/build

serve:

miniserve ./static --index index.html

I would love these two to be automated just like in javascript with nodemon.

1 Answers

Use cargo-watch and pass shell commands to execute using -s or --shell flags:

cargo watch -s 'wasm-pack build --target web --out-name wasm --out-dir ./static/build && miniserve ./static --index index.html'

Thanks for the help Lux and kmdreko

Related