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

10
build
View file

@ -150,17 +150,17 @@ task_client() {
task_client-watch() {
set_title "Client Watcher";
execute node_modules/rollup/bin/rollup --watch --sourcemap --config rollup.config.js &
echo -e "Watching for changes.";
while :; do # : = infinite loop
# Wait for an update
# inotifywait's non-0 exit code forces an exit for some reason :-/
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
# This still doesn't work though, which is *really* annoying
stage_begin "Rebuilding client code";
./build client;
stage_end $?;
task_begin "Copying html";
execute cp client_src/index.html "app/";
task_end $?;
done
}