Skip to content

Commit

Permalink
fix(@angular/build): disable JS transformer persistent cache on web c…
Browse files Browse the repository at this point in the history
…ontainers

The backing store for the persistent caching of the JavaScript transformers
is not currently supported on web containers. To allow other potential forms
of caching, the JavaScript transformer caching is now selectively disabled
when executed on a web container. This allows for development server prebundling
to be used on web containers if needed.
  • Loading branch information
clydin committed May 31, 2024
1 parent 7ea24a8 commit 86a0723
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export function createCompilerPlugin(
let setupWarnings: PartialMessage[] | undefined = [];
const preserveSymlinks = build.initialOptions.preserveSymlinks;

// Initialize a worker pool for JavaScript transformations
// Initialize a worker pool for JavaScript transformations.
// Webcontainers currently do not support this persistent cache store.
let cacheStore: import('../lmdb-cache-store').LmbdCacheStore | undefined;
if (pluginOptions.sourceFileCache?.persistentCachePath) {
if (pluginOptions.sourceFileCache?.persistentCachePath && !process.versions.webcontainer) {
const { LmbdCacheStore } = await import('../lmdb-cache-store');
cacheStore = new LmbdCacheStore(
path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db'),
Expand Down

0 comments on commit 86a0723

Please sign in to comment.