From 7c5ecb5b5c13b24b1a86c9bd5bb74b709dc2a6e8 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 2 Oct 2017 19:47:27 -0700 Subject: [PATCH] fix(compiler): also count generated files to determine whether to use single file emit --- packages/compiler-cli/src/transformers/program.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index 4461fc9fae..55bf7bee57 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -227,9 +227,10 @@ class AngularCompilerProgram implements Program { let emitResult: ts.EmitResult; let emittedUserTsCount: number; try { - const emitChangedFilesOnly = this._changedNonGenFileNames && - this._changedNonGenFileNames.length < MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT; - if (emitChangedFilesOnly) { + const useSingleFileEmit = this._changedNonGenFileNames && + (this._changedNonGenFileNames.length + genTsFiles.length) < + MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT; + if (useSingleFileEmit) { const fileNamesToEmit = [...this._changedNonGenFileNames !, ...genTsFiles.map(gf => gf.genFileUrl)]; emitResult = mergeEmitResults(