Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #683 from cristianl/pr-make-live-optional
Browse files Browse the repository at this point in the history
Allow disabling live reload
  • Loading branch information
Rich-Harris authored May 21, 2019
2 parents 594cb0a + 1fc169e commit 2bb173f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,19 @@ class Watcher extends EventEmitter {
});
}
}
),

fs.watch(`${src}/template.html`, () => {
this.dev_server.send({
action: 'reload'
});
})
)
);

if (this.live) {
this.filewatchers.push(
fs.watch(`${src}/template.html`, () => {
this.dev_server.send({
action: 'reload'
});
})
);
}

let deferred = new Deferred();

// TODO watch the configs themselves?
Expand Down Expand Up @@ -252,7 +256,7 @@ class Watcher extends EventEmitter {
this.dev_server.send({
status: 'completed'
});
} else {
} else if (this.live) {
this.dev_server.send({
action: 'reload'
});
Expand Down

0 comments on commit 2bb173f

Please sign in to comment.