Optimise client-watch by using rollup --watch

This commit is contained in:
Starbeamrainbowlabs 2019-07-25 14:33:02 +01:00
parent 7a96f87b2d
commit edb6362688
1 changed files with 5 additions and 5 deletions

10
build
View File

@ -150,17 +150,17 @@ task_client() {
task_client-watch() { task_client-watch() {
set_title "Client Watcher"; set_title "Client Watcher";
execute node_modules/rollup/bin/rollup --watch --sourcemap --config rollup.config.js &
echo -e "Watching for changes."; echo -e "Watching for changes.";
while :; do # : = infinite loop while :; do # : = infinite loop
# Wait for an update # Wait for an update
# inotifywait's non-0 exit code forces an exit for some reason :-/ # inotifywait's non-0 exit code forces an exit for some reason :-/
inotifywait -qr --event modify --format '%:e %f' client_src rollup.config.js; inotifywait -qr --event modify --format '%:e %f' client_src rollup.config.js;
# Rebuild the client code - spawn a sub-process to avoid the hard exit task_begin "Copying html";
# This still doesn't work though, which is *really* annoying execute cp client_src/index.html "app/";
stage_begin "Rebuilding client code"; task_end $?;
./build client;
stage_end $?;
done done
} }