Optimise client-watch by using rollup --watch
This commit is contained in:
parent
7a96f87b2d
commit
edb6362688
1 changed files with 5 additions and 5 deletions
10
build
10
build
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue