Skip to content

Commit 1f31103

Browse files
committed
refactor(@angular/build): flatten builderName in cache directory path
Strip '@' and replace '/' in addition to ':' when normalizing builderName in normalizeCacheOptions so scoped builder names produce a single flat cache directory instead of nested subdirectories.
1 parent 07845f0 commit 1f31103

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/angular/build/src/utils/normalize-cache.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function normalizeCacheOptions(
140140

141141
const cacheBasePath = getCacheBasePath(workspaceRoot, path);
142142
const localCacheBasePath = isAbsolute(path) ? path : resolve(workspaceRoot, path);
143-
const normalizedBuilderName = builderName.replaceAll(':', '-');
143+
const normalizedBuilderName = builderName.replace('@', '').replaceAll(/[:/]/g, '-');
144144

145145
return {
146146
enabled: cacheEnabled,

‎packages/angular/build/src/utils/normalize-cache_spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ describe('normalizeCacheOptions', () => {
283283
const options = normalizeCacheOptions({}, workspaceRoot, 'my-app', '@angular/build:unit-test');
284284

285285
expect(options.path).toBe(
286-
resolve(workspaceRoot, '.angular/cache/0.0.0-PLACEHOLDER/my-app/@angular/build-unit-test'),
286+
resolve(workspaceRoot, '.angular/cache/0.0.0-PLACEHOLDER/my-app/angular-build-unit-test'),
287287
);
288288
expect(options.localPath).toBe(
289-
resolve(workspaceRoot, '.angular/cache/0.0.0-PLACEHOLDER/my-app/@angular/build-unit-test'),
289+
resolve(workspaceRoot, '.angular/cache/0.0.0-PLACEHOLDER/my-app/angular-build-unit-test'),
290290
);
291291
});
292292
});

0 commit comments

Comments
 (0)