From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/watchpack/lib/DirectoryWatcher.js | 48 +++++++++++++++++--------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'node_modules/watchpack/lib/DirectoryWatcher.js') diff --git a/node_modules/watchpack/lib/DirectoryWatcher.js b/node_modules/watchpack/lib/DirectoryWatcher.js index 908ff2397..8c7c9cea9 100644 --- a/node_modules/watchpack/lib/DirectoryWatcher.js +++ b/node_modules/watchpack/lib/DirectoryWatcher.js @@ -56,7 +56,8 @@ function DirectoryWatcher(directoryPath, options) { ignorePermissionErrors: true, ignored: options.ignored, usePolling: options.poll ? true : undefined, - interval: typeof options.poll === "number" ? options.poll : undefined + interval: typeof options.poll === "number" ? options.poll : undefined, + disableGlobbing: true }); this.watcher.on("add", this.onFileAdded.bind(this)); this.watcher.on("addDir", this.onDirectoryAdded.bind(this)); @@ -119,24 +120,37 @@ DirectoryWatcher.prototype.setFileTime = function setFileTime(filePath, mtime, i }; 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); + }); + } } } } -- cgit v1.2.3