upgrade watchpack
This commit is contained in:
parent
5bcafa64e2
commit
b65f82e965
|
@ -28,7 +28,7 @@ class NodeWatchFileSystem {
|
|||
|
||||
/**
|
||||
* @param {Iterable<string>} files watched files
|
||||
* @param {Iterable<string>} dirs watched directories
|
||||
* @param {Iterable<string>} directories watched directories
|
||||
* @param {Iterable<string>} 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();
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue