perf(ngcc): only load if it is needed (#36486)

PR Close #36486
This commit is contained in:
Pete Bacon Darwin 2020-04-09 16:02:57 +01:00 committed by atscott
parent ec0ce6005a
commit 3bedfdac9d
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,6 @@ import {NgccConfiguration} from './packages/configuration';
import {EntryPoint, EntryPointJsonProperty, EntryPointPackageJson, getEntryPointFormat, SUPPORTED_FORMAT_PROPERTIES} from './packages/entry_point'; import {EntryPoint, EntryPointJsonProperty, EntryPointPackageJson, getEntryPointFormat, SUPPORTED_FORMAT_PROPERTIES} from './packages/entry_point';
import {makeEntryPointBundle} from './packages/entry_point_bundle'; import {makeEntryPointBundle} from './packages/entry_point_bundle';
import {EntryPointManifest, InvalidatingEntryPointManifest} from './packages/entry_point_manifest'; import {EntryPointManifest, InvalidatingEntryPointManifest} from './packages/entry_point_manifest';
import {Transformer} from './packages/transformer';
import {PathMappings} from './utils'; import {PathMappings} from './utils';
import {cleanOutdatedPackages} from './writing/cleaning/package_cleaner'; import {cleanOutdatedPackages} from './writing/cleaning/package_cleaner';
import {FileWriter} from './writing/file_writer'; import {FileWriter} from './writing/file_writer';
@ -315,6 +314,7 @@ export function mainNgcc({
const createCompileFn: CreateCompileFn = onTaskCompleted => { const createCompileFn: CreateCompileFn = onTaskCompleted => {
const fileWriter = getFileWriter( const fileWriter = getFileWriter(
fileSystem, logger, pkgJsonUpdater, createNewEntryPointFormats, errorOnFailedEntryPoint); fileSystem, logger, pkgJsonUpdater, createNewEntryPointFormats, errorOnFailedEntryPoint);
const {Transformer} = require('./packages/transformer');
const transformer = new Transformer(fileSystem, logger, tsConfig); const transformer = new Transformer(fileSystem, logger, tsConfig);
return (task: Task) => { return (task: Task) => {