Skip to content

Commit bdc1bb8

Browse files
author
maruthan
committed
fix(@angular/build): invalidate cached SCSS errors when source files are corrected
Normalize the file path before looking it up in the dependency map during cache invalidation. Without normalization, the path used for invalidation could differ from the one stored during compilation, causing stale error results to persist after fixing SCSS errors. Fixes #32744
1 parent f1ed025 commit bdc1bb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/angular/build/src/tools/esbuild/load-result-cache.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export class MemoryLoadResultCache implements LoadResultCache {
7070
}
7171

7272
invalidate(path: string): boolean {
73-
const affectedPaths = this.#fileDependencies.get(path);
73+
const normalizedPath = normalize(path);
74+
const affectedPaths = this.#fileDependencies.get(normalizedPath);
7475
let found = false;
7576

7677
if (affectedPaths) {
@@ -79,7 +80,7 @@ export class MemoryLoadResultCache implements LoadResultCache {
7980
found = true;
8081
}
8182
}
82-
this.#fileDependencies.delete(path);
83+
this.#fileDependencies.delete(normalizedPath);
8384
}
8485

8586
return found;

0 commit comments

Comments
 (0)