fix(compiler): also count generated files to determine whether to use single file emit

This commit is contained in:
Tobias Bosch 2017-10-02 19:47:27 -07:00 committed by Alex Rickabaugh
parent 1058b2a778
commit 7c5ecb5b5c
1 changed files with 4 additions and 3 deletions

View File

@ -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(