Skip to content

Commit 2265f63

Browse files
clydindgp1130
authored andcommitted
refactor(@angular/build): cleanup persistent JS transformer cache on plugin dispose
Close and allow the persistent JS transformer cache to cleanup open lock files when the Angular compiler plugin is disposed. While this is not strictly necessary, it does help prevent extra cache lock files from being retained after build completion. (cherry picked from commit 7a539ab)
1 parent 4111153 commit 2265f63

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ export function createCompilerPlugin(
6363
const preserveSymlinks = build.initialOptions.preserveSymlinks;
6464

6565
// Initialize a worker pool for JavaScript transformations
66-
let cacheStore;
66+
let cacheStore: LmbdCacheStore | undefined;
6767
if (pluginOptions.sourceFileCache?.persistentCachePath) {
6868
cacheStore = new LmbdCacheStore(
69-
pluginOptions.sourceFileCache.persistentCachePath + '/angular-compiler.db',
69+
path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db'),
7070
);
7171
}
7272
const javascriptTransformer = new JavaScriptTransformer(
@@ -446,6 +446,7 @@ export function createCompilerPlugin(
446446
sharedTSCompilationState?.dispose();
447447
void stylesheetBundler.dispose();
448448
void compilation.close?.();
449+
void cacheStore?.close();
449450
});
450451

451452
/**

0 commit comments

Comments
 (0)