diff --git a/lib/node/NodeWatchFileSystem.js b/lib/node/NodeWatchFileSystem.js index d2acc3136..316dacb5f 100644 --- a/lib/node/NodeWatchFileSystem.js +++ b/lib/node/NodeWatchFileSystem.js @@ -28,7 +28,7 @@ class NodeWatchFileSystem { /** * @param {Iterable} files watched files - * @param {Iterable} dirs watched directories + * @param {Iterable} directories watched directories * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {TODO} options options object @@ -36,12 +36,20 @@ class NodeWatchFileSystem { * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ - watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { + watch( + files, + directories, + missing, + startTime, + options, + callback, + callbackUndelayed + ) { if (!files || typeof files[Symbol.iterator] !== "function") { throw new Error("Invalid arguments: 'files'"); } - if (!dirs || typeof dirs[Symbol.iterator] !== "function") { - throw new Error("Invalid arguments: 'dirs'"); + if (!directories || typeof directories[Symbol.iterator] !== "function") { + throw new Error("Invalid arguments: 'directories'"); } if (!missing || typeof missing[Symbol.iterator] !== "function") { throw new Error("Invalid arguments: 'missing'"); @@ -77,10 +85,7 @@ class NodeWatchFileSystem { callback(null, times, times, changes, removals); }); - const filesSet = new Set(files); - for (const item of missing) filesSet.add(item); - - this.watcher.watch(filesSet, dirs, startTime); + this.watcher.watch({ files, directories, missing, startTime }); if (oldWatcher) { oldWatcher.close(); diff --git a/package.json b/package.json index 912192430..81f1f6d3d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "schema-utils": "^2.5.0", "tapable": "2.0.0-beta.8", "terser-webpack-plugin": "^2.2.1", - "watchpack": "2.0.0-beta.9", + "watchpack": "2.0.0-beta.10", "webpack-sources": "2.0.0-beta.7" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index d829e43b6..ce9925d7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6531,10 +6531,10 @@ wast-loader@^1.5.5: dependencies: wabt "1.0.0-nightly.20180421" -watchpack@2.0.0-beta.9: - version "2.0.0-beta.9" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0-beta.9.tgz#c9a2d25af677203c5a0727803d72239d8f60499d" - integrity sha512-tk6i7Mh7zt4Z6c7Pa7PBMRPM04es+1KB2JITgR0O/SZLKnCbT05u/B53WJp+FcPZLes3HQZ1d27fYy6FRFYb5Q== +watchpack@2.0.0-beta.10: + version "2.0.0-beta.10" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0-beta.10.tgz#6e4a5b16bda08a5a3ce9851f166a45a8860066bb" + integrity sha512-JR/S6jbW/hC+xAHG+AxZjkIH/yCxC/yQfCJT8FnZDrZf//tCd6O3wtcEuCkgFmWVERC2IdnlYvmzwa1RJJKg0A== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2"