* Returns a compiler watcher. * @param {WatchOptions} watchOptions the watcher's options * @param {Callback<Stats>} handler signals when the call finishes * @returns {Watching | undefined} a compiler watcher
(watchOptions, handler)
| 528 | * @returns {Watching | undefined} a compiler watcher |
| 529 | */ |
| 530 | watch(watchOptions, handler) { |
| 531 | if (this.running) { |
| 532 | handler(new ConcurrentCompilationError()); |
| 533 | return; |
| 534 | } |
| 535 | |
| 536 | this.running = true; |
| 537 | this.watchMode = true; |
| 538 | this.watching = new Watching(this, watchOptions, handler); |
| 539 | return this.watching; |
| 540 | } |
| 541 | |
| 542 | /** |
| 543 | * Processes the provided stat. |