From 71534aadc403404e2dc9bc12054f32c3ed157db9 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:05:08 -0400 Subject: [PATCH] fix(@angular/build): check referenced files against native file paths When checking for bundler context invalidation for any referenced files, the native path format is now used to ensure that the watch files can be correctly matched. This is particularly important for Windows due to the differing path segment separator. (cherry picked from commit d16a9aa4379d2840a6dcad2bd20c83bfc2ef634b) --- .../build/src/tools/esbuild/angular/source-file-cache.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;