build: Add support for bazelOptions.maxCacheSizeMb in ngc-wrapped. (#22511)
PR Close #22511
This commit is contained in:
parent
dd534471ec
commit
ab790f3c84
|
@ -95,6 +95,13 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
|
|||
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
|
||||
let fileLoader: FileLoader;
|
||||
|
||||
if (bazelOpts.maxCacheSizeMb !== undefined) {
|
||||
const maxCacheSizeBytes = bazelOpts.maxCacheSizeMb * (1 << 20);
|
||||
fileCache.setMaxCacheSize(maxCacheSizeBytes);
|
||||
} else {
|
||||
fileCache.resetMaxCacheSize();
|
||||
}
|
||||
|
||||
if (inputs) {
|
||||
fileLoader = new CachedFileLoader(fileCache, allowNonHermeticReads);
|
||||
// Resolve the inputs to absolute paths to match TypeScript internals
|
||||
|
|
Loading…
Reference in New Issue