Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Commit

Permalink
Only start compiling when initial chokidar scan is complete;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Jan 12, 2018
1 parent bdb8c44 commit f802c26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ const refresh = () => {
});
};

watch(source).on('all', () => {
if (updated) {
let ready = false;
watch(source).on('all', event => {
if (!ready && event === 'ready') {
ready = true;
} else if (ready && updated) {
updated = false;
compile(null, null, refresh);
}
Expand Down

0 comments on commit f802c26

Please sign in to comment.