upgrade watchpack

This commit is contained in:
Tobias Koppers 2019-11-06 18:10:00 +01:00
parent 43afd3d8ee
commit b9fd96943a
3 changed files with 17 additions and 11 deletions

View File

@ -16,12 +16,20 @@ class NodeWatchFileSystem {
this.watcher = new Watchpack(this.watcherOptions);
}
watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) {
watch(
files,
directories,
missing,
startTime,
options,
callback,
callbackUndelayed
) {
if (!Array.isArray(files)) {
throw new Error("Invalid arguments: 'files'");
}
if (!Array.isArray(dirs)) {
throw new Error("Invalid arguments: 'dirs'");
if (!Array.isArray(directories)) {
throw new Error("Invalid arguments: 'directories'");
}
if (!Array.isArray(missing)) {
throw new Error("Invalid arguments: 'missing'");
@ -44,8 +52,6 @@ class NodeWatchFileSystem {
if (callbackUndelayed) {
this.watcher.once("change", callbackUndelayed);
}
const cachedFiles = files;
const cachedDirs = dirs;
this.watcher.once("aggregated", (changes, removals) => {
if (this.inputFileSystem && this.inputFileSystem.purge) {
for (const item of changes) {
@ -59,7 +65,7 @@ class NodeWatchFileSystem {
callback(null, times, times, removals);
});
this.watcher.watch(cachedFiles.concat(missing), cachedDirs, startTime);
this.watcher.watch({ files, directories, missing, startTime });
if (oldWatcher) {
oldWatcher.close();

View File

@ -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.4"
},
"devDependencies": {

View File

@ -6405,10 +6405,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"