From 3bedfdac9d3ce8583c58eeb5641460c021b720e3 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 9 Apr 2020 16:02:57 +0100 Subject: [PATCH] perf(ngcc): only load if it is needed (#36486) PR Close #36486 --- packages/compiler-cli/ngcc/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/ngcc/src/main.ts b/packages/compiler-cli/ngcc/src/main.ts index e0565b4c5b..1f63a029bb 100644 --- a/packages/compiler-cli/ngcc/src/main.ts +++ b/packages/compiler-cli/ngcc/src/main.ts @@ -44,7 +44,6 @@ import {NgccConfiguration} from './packages/configuration'; import {EntryPoint, EntryPointJsonProperty, EntryPointPackageJson, getEntryPointFormat, SUPPORTED_FORMAT_PROPERTIES} from './packages/entry_point'; import {makeEntryPointBundle} from './packages/entry_point_bundle'; import {EntryPointManifest, InvalidatingEntryPointManifest} from './packages/entry_point_manifest'; -import {Transformer} from './packages/transformer'; import {PathMappings} from './utils'; import {cleanOutdatedPackages} from './writing/cleaning/package_cleaner'; import {FileWriter} from './writing/file_writer'; @@ -315,6 +314,7 @@ export function mainNgcc({ const createCompileFn: CreateCompileFn = onTaskCompleted => { const fileWriter = getFileWriter( fileSystem, logger, pkgJsonUpdater, createNewEntryPointFormats, errorOnFailedEntryPoint); + const {Transformer} = require('./packages/transformer'); const transformer = new Transformer(fileSystem, logger, tsConfig); return (task: Task) => {