perf(ngcc): cache parsed tsconfig between runs (#37417)
This commit will store a cached copy of the parsed tsconfig that can be reused if the tsconfig path is the same. This will improve the ngcc "noop" case, where there is no processing to do, when the entry-points have already been processed. Previously we were parsing this config every time we checked for entry-points to process, which can take up to seconds in some cases. Resolves #36882 PR Close #37417
This commit is contained in:

committed by
atscott

parent
2021ad12cf
commit
6e7bd939f6
@ -15,6 +15,7 @@ import {Folder, MockFileSystem, runInEachFileSystem, TestFile} from '../../../sr
|
||||
import {loadStandardTestFiles, loadTestFiles} from '../../../test/helpers';
|
||||
import {getLockFilePath} from '../../src/locking/lock_file';
|
||||
import {mainNgcc} from '../../src/main';
|
||||
import {clearTsConfigCache} from '../../src/ngcc_options';
|
||||
import {hasBeenProcessed, markAsProcessed} from '../../src/packages/build_marker';
|
||||
import {EntryPointJsonProperty, EntryPointPackageJson, SUPPORTED_FORMAT_PROPERTIES} from '../../src/packages/entry_point';
|
||||
import {EntryPointManifestFile} from '../../src/packages/entry_point_manifest';
|
||||
@ -42,6 +43,10 @@ runInEachFileSystem(() => {
|
||||
spyOn(os, 'cpus').and.returnValue([{model: 'Mock CPU'} as any]);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
clearTsConfigCache();
|
||||
});
|
||||
|
||||
/**
|
||||
* Sets up the esm5 format in the Angular core package. By default, package output
|
||||
* no longer contains esm5 output, so we process the fesm2015 file into ES5 and
|
||||
|
Reference in New Issue
Block a user