Skip to content

Commit

Permalink
fix(@angular/build): check referenced files against native file paths
Browse files Browse the repository at this point in the history
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 d16a9aa)
  • Loading branch information
clydin committed Nov 2, 2024
1 parent f0fb82b commit 71534aa
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class SourceFileCache extends Map<string, ts.SourceFile> {
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) {
Expand All @@ -44,8 +45,6 @@ export class SourceFileCache extends Map<string, ts.SourceFile> {

invalid = this.delete(file) || invalid;
this.modifiedFiles.add(file);

invalid = extraWatchFiles.has(file) || invalid;
}

return invalid;
Expand Down

0 comments on commit 71534aa

Please sign in to comment.