* Processes the provided file. * @param {Iterable<string>} files watched files * @param {Iterable<string>} dirs watched directories * @param {Iterable<string>} missing watched existence entries * @returns {void}
(files, dirs, missing)
| 372 | * @returns {void} |
| 373 | */ |
| 374 | watch(files, dirs, missing) { |
| 375 | this.pausedWatcher = null; |
| 376 | this.watcher = |
| 377 | /** @type {WatchFileSystem} */ |
| 378 | (this.compiler.watchFileSystem).watch( |
| 379 | files, |
| 380 | dirs, |
| 381 | missing, |
| 382 | /** @type {number} */ (this.lastWatcherStartTime), |
| 383 | this.watchOptions, |
| 384 | ( |
| 385 | err, |
| 386 | fileTimeInfoEntries, |
| 387 | contextTimeInfoEntries, |
| 388 | changedFiles, |
| 389 | removedFiles |
| 390 | ) => { |
| 391 | if (err) { |
| 392 | this.compiler.modifiedFiles = undefined; |
| 393 | this.compiler.removedFiles = undefined; |
| 394 | this.compiler.fileTimestamps = undefined; |
| 395 | this.compiler.contextTimestamps = undefined; |
| 396 | this.compiler.fsStartTime = undefined; |
| 397 | return this.handler(err); |
| 398 | } |
| 399 | this._invalidate( |
| 400 | fileTimeInfoEntries, |
| 401 | contextTimeInfoEntries, |
| 402 | changedFiles, |
| 403 | removedFiles |
| 404 | ); |
| 405 | this._onChange(); |
| 406 | }, |
| 407 | (fileName, changeTime) => { |
| 408 | if (!this._invalidReported) { |
| 409 | this._invalidReported = true; |
| 410 | this.compiler.hooks.invalid.call(fileName, changeTime); |
| 411 | } |
| 412 | this._onInvalid(); |
| 413 | } |
| 414 | ); |
| 415 | } |
| 416 | |
| 417 | /** |
| 418 | * Processes the provided error callback. |