From afa31fcb7f6541183c82ce18af55530506ba43e1 Mon Sep 17 00:00:00 2001 From: Luke Brody Date: Sat, 1 Feb 2025 00:40:00 -0700 Subject: [PATCH] Implement better watch script (#899) The python build step for the site can take a while, but sometimes you just want to restart the rspack watcher So, press ^C once and wait 1 second to just restart the watcher, press ^C again once the watcher shuts down to stop watching entirely. --- react/watch.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/react/watch.sh b/react/watch.sh index 3dbb51be2..60acf6119 100755 --- a/react/watch.sh +++ b/react/watch.sh @@ -5,4 +5,9 @@ set -e cd .. python create_website.py $1 --mode=dev --no-data --no-geo --no-juxta cd react -rspack serve --mode=development --watch --env directory=$1 + +while true; do + rspack serve --mode=development --watch --env directory=$1 + echo 'Restarting watcher... Press ^C again to stop watching.' + sleep 1 +done