diff --git a/packages/nx/src/command-line/watch/watch.ts b/packages/nx/src/command-line/watch/watch.ts index 09eeb833f3d..1bcaa66fb30 100644 --- a/packages/nx/src/command-line/watch/watch.ts +++ b/packages/nx/src/command-line/watch/watch.ts @@ -48,11 +48,11 @@ export class BatchFunctionRunner { this.pendingFiles.add(fileChange.path); }); - return this.process(); + return this.process(true); } - private async process() { - if (!this.running && this.hasPending) { + private async process(runAnyway: boolean) { + if (!this.running && (this.hasPending || runAnyway)) { this.running = true; // Clone the pending projects and files before clearing @@ -65,7 +65,7 @@ export class BatchFunctionRunner { return this.callback(projects, files).then(() => { this.running = false; - this.process(); + this.process(false); }); } else { this._verbose &&