watchpack
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -59,3 +59,4 @@ /* | ||
usePolling: options.poll ? true : undefined, | ||
interval: typeof options.poll === "number" ? options.poll : undefined | ||
interval: typeof options.poll === "number" ? options.poll : undefined, | ||
disableGlobbing: true | ||
}); | ||
@@ -123,21 +124,34 @@ this.watcher.on("add", this.onFileAdded.bind(this)); | ||
DirectoryWatcher.prototype.setDirectory = function setDirectory(directoryPath, exist, initial, type) { | ||
var old = this.directories[directoryPath]; | ||
if(!old) { | ||
if(exist) { | ||
if(this.nestedWatching) { | ||
this.createNestedWatcher(directoryPath); | ||
} else { | ||
this.directories[directoryPath] = true; | ||
} | ||
if(directoryPath === this.path) { | ||
if(!initial && this.watchers[withoutCase(this.path)]) { | ||
this.watchers[withoutCase(this.path)].forEach(function(w) { | ||
w.emit("change", directoryPath, w.data, initial ? "initial" : type); | ||
}); | ||
} | ||
} else { | ||
if(!exist) { | ||
if(this.nestedWatching) | ||
this.directories[directoryPath].close(); | ||
delete this.directories[directoryPath]; | ||
if(!initial && this.watchers[withoutCase(this.path)]) { | ||
this.watchers[withoutCase(this.path)].forEach(function(w) { | ||
w.emit("change", directoryPath, w.data, initial ? "initial" : type); | ||
}); | ||
var old = this.directories[directoryPath]; | ||
if(!old) { | ||
if(exist) { | ||
if(this.nestedWatching) { | ||
this.createNestedWatcher(directoryPath); | ||
} else { | ||
this.directories[directoryPath] = true; | ||
} | ||
if(!initial && this.watchers[withoutCase(this.path)]) { | ||
this.watchers[withoutCase(this.path)].forEach(function(w) { | ||
w.emit("change", directoryPath, w.data, initial ? "initial" : type); | ||
}); | ||
} | ||
} | ||
} else { | ||
if(!exist) { | ||
if(this.nestedWatching) | ||
this.directories[directoryPath].close(); | ||
delete this.directories[directoryPath]; | ||
if(!initial && this.watchers[withoutCase(this.path)]) { | ||
this.watchers[withoutCase(this.path)].forEach(function(w) { | ||
w.emit("change", directoryPath, w.data, initial ? "initial" : type); | ||
}); | ||
} | ||
} | ||
} | ||
@@ -144,0 +158,0 @@ } |
{ | ||
"name": "watchpack", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "", | ||
@@ -41,5 +41,5 @@ "main": "./lib/watchpack.js", | ||
"async": "^2.1.2", | ||
"chokidar": "^1.4.3", | ||
"chokidar": "^1.7.0", | ||
"graceful-fs": "^4.1.2" | ||
} | ||
} |
21751
483
Updatedchokidar@^1.7.0