feat: filter reload trigger files

This commit is contained in:
Valerio Ageno
2024-05-30 21:03:09 +02:00
parent d7d0001299
commit 930e7bc851
+11 -7
View File
@@ -53,13 +53,17 @@ pub async fn watch() -> Result<()> {
let wx = Watchexec::new(move |mut action| {
for event in action.events.iter() {
for _ in event.paths() {
run_server.stop();
println!("Reloading server...");
build_ssr_bundle.stop();
build_ssr_bundle.start();
bundle_axum_source();
run_server.start();
for path in event.paths() {
if path.0.to_string_lossy().ends_with(".rs")
|| path.0.to_string_lossy().ends_with("sx")
{
run_server.stop();
println!("Reloading server...");
build_ssr_bundle.stop();
build_ssr_bundle.start();
bundle_axum_source();
run_server.start();
}
}
}