Skip to content

Commit

Permalink
revert change, readd mtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 22, 2017
1 parent 4bc933c commit 421c730
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/watchpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function Watchpack(options) {
};
this.fileWatchers = [];
this.dirWatchers = [];
this.mtimes = Object.create(null);
this.paused = false;
this.aggregatedChanges = [];
this.aggregatedRemovals = [];
Expand Down Expand Up @@ -110,6 +111,7 @@ Watchpack.prototype._dirWatcher = function _dirWatcher(item, watcher) {

Watchpack.prototype._onChange = function _onChange(item, mtime, file) {
file = file || item;
this.mtimes[file] = mtime;
if(this.paused) return;
this.emit("change", file, mtime);
if(this.aggregateTimeout)
Expand All @@ -121,6 +123,7 @@ Watchpack.prototype._onChange = function _onChange(item, mtime, file) {

Watchpack.prototype._onRemove = function _onRemove(item, file) {
file = file || item;
delete this.mtimes[item];
if(this.paused) return;
this.emit("remove", item);
if(this.aggregateTimeout)
Expand Down

0 comments on commit 421c730

Please sign in to comment.