Skip to content

Commit 61ee772

Browse files
committed
fix(@angular/build): address review feedback in persistent load result cache
Uniformly deduplicate watch files via a single Set to avoid redundant stat and readFile operations during metadata computation when result.watchFiles contains duplicates.
1 parent bafea10 commit 61ee772

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ export class PersistentLoadResultCache implements LoadResultCache {
316316
const knownContents = filePath
317317
? new Map<string, string | Uint8Array>([[filePath, content]])
318318
: undefined;
319-
const allWatchFiles = filePath
320-
? Array.from(new Set([filePath, ...(result.watchFiles ?? [])]))
321-
: (result.watchFiles ?? []);
319+
const allWatchFiles = Array.from(
320+
new Set(filePath ? [filePath, ...(result.watchFiles ?? [])] : result.watchFiles),
321+
);
322322
const watchFilesMetadata = await computeMetadataForWatchFiles(allWatchFiles, knownContents);
323323

324324
await this.persistentStore.put(cacheKey, {

0 commit comments

Comments
 (0)