Skip to content

Commit 4ba6907

Browse files
committed
fixup! perf(@angular/build): cache transformed configuration in TypeScript compilation
1 parent 1171fc7 commit 4ba6907

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎packages/angular/build/src/tools/angular/compilation/typescript-compilation.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,22 @@ export abstract class TypeScriptCompilation extends AngularCompilation {
140140
if (this.#extendedConfigCache.has(posixFile)) {
141141
cacheKey = posixFile;
142142
} else {
143-
// TypeScript lowercases the keys of the extended config cache on case-insensitive operating systems.
143+
// Check with lowercased key because TypeScript lowercases the keys
144+
// of the extended config cache on case-insensitive operating systems.
144145
const lowerCasedPosixFile = posixFile.toLowerCase();
145146
if (this.#extendedConfigCache.has(lowerCasedPosixFile)) {
146147
cacheKey = lowerCasedPosixFile;
147148
}
148149
}
149150

150-
if (cacheKey) {
151-
// If a tsconfig changes, we need to re-read the configuration.
152-
this.#cachedConfiguration = undefined;
153-
this.#cachedRootFiles = undefined;
154-
this.#extendedConfigCache.delete(cacheKey);
151+
if (!cacheKey) {
152+
continue;
155153
}
154+
155+
// If a tsconfig changes, we need to re-read the configuration.
156+
this.#cachedConfiguration = undefined;
157+
this.#cachedRootFiles = undefined;
158+
this.#extendedConfigCache.delete(cacheKey);
156159
}
157160
}
158161
}

0 commit comments

Comments
 (0)