diff --git a/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts b/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts index 3b733cb412d5..2bc38bd12a89 100644 --- a/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts +++ b/packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts @@ -36,6 +36,7 @@ export class SourceFileCache extends Map { for (let file of files) { file = path.normalize(file); invalid = this.loadResultCache.invalidate(file) || invalid; + invalid = extraWatchFiles.has(file) || invalid; // Normalize separators to allow matching TypeScript Host paths if (USING_WINDOWS) { @@ -44,8 +45,6 @@ export class SourceFileCache extends Map { invalid = this.delete(file) || invalid; this.modifiedFiles.add(file); - - invalid = extraWatchFiles.has(file) || invalid; } return invalid;