Skip to content

Commit

Permalink
fix(@angular/build): disable persistent disk caching inside webcontai…
Browse files Browse the repository at this point in the history
…ners by default

When using the build system within a Web container, persistent disk caching
is now disabled by default. Persistent disk caching does not provide a
benefit for typical use cases and can cause increased browser memory usage
when enabled.

(cherry picked from commit ad36c46)
  • Loading branch information
clydin committed May 23, 2024
1 parent 01842f5 commit 6b6a76a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/angular/build/src/utils/normalize-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export function normalizeCacheOptions(
): NormalizedCachedOptions {
const cacheMetadata = hasCacheMetadata(projectMetadata) ? projectMetadata.cli.cache : {};

const { enabled = true, environment = 'local', path = '.angular/cache' } = cacheMetadata;
const {
// Webcontainers do not currently benefit from persistent disk caching and can lead to increased browser memory usage
enabled = !process.versions.webcontainer,
environment = 'local',
path = '.angular/cache',
} = cacheMetadata;
const isCI = process.env['CI'] === '1' || process.env['CI']?.toLowerCase() === 'true';

let cacheEnabled = enabled;
Expand Down

0 comments on commit 6b6a76a

Please sign in to comment.