@@ -1012,9 +1012,9 @@ namespace ts {
1012
1012
return ;
1013
1013
}
1014
1014
1015
- const buildResult = status . type === UpToDateStatusType . OutOfDateWithPrepend ?
1016
- updateBundle ( resolved ) : // Fake that files have been built by manipulating prepend and existing output
1017
- buildSingleProject ( resolved ) ; // Actual build
1015
+ const buildResult = needsBuild ( status , resolved ) ?
1016
+ buildSingleProject ( resolved ) : // Actual build
1017
+ updateBundle ( resolved ) ; // Fake that files have been built by manipulating prepend and existing output
1018
1018
if ( buildResult & BuildResultFlags . AnyErrors ) return ;
1019
1019
1020
1020
const { referencingProjectsMap, buildQueue } = getGlobalDependencyGraph ( ) ;
@@ -1424,9 +1424,10 @@ namespace ts {
1424
1424
continue ;
1425
1425
}
1426
1426
1427
- const buildResult = status . type === UpToDateStatusType . OutOfDateWithPrepend && ! options . force ?
1428
- updateBundle ( next ) : // Fake that files have been built by manipulating prepend and existing output
1429
- buildSingleProject ( next ) ; // Actual build
1427
+ const buildResult = needsBuild ( status , next ) ?
1428
+ buildSingleProject ( next ) : // Actual build
1429
+ updateBundle ( next ) ; // Fake that files have been built by manipulating prepend and existing output
1430
+
1430
1431
anyFailed = anyFailed || ! ! ( buildResult & BuildResultFlags . AnyErrors ) ;
1431
1432
}
1432
1433
reportErrorSummary ( ) ;
@@ -1440,6 +1441,15 @@ namespace ts {
1440
1441
return anyFailed ? ExitStatus . DiagnosticsPresent_OutputsSkipped : ExitStatus . Success ;
1441
1442
}
1442
1443
1444
+ function needsBuild ( status : UpToDateStatus , configFile : ResolvedConfigFileName ) {
1445
+ if ( status . type !== UpToDateStatusType . OutOfDateWithPrepend || options . force ) return true ;
1446
+ const config = parseConfigFile ( configFile ) ;
1447
+ return ! config ||
1448
+ config . fileNames . length === 0 ||
1449
+ ! ! config . errors . length ||
1450
+ ! isIncrementalCompilation ( config . options ) ;
1451
+ }
1452
+
1443
1453
function reportParseConfigFileDiagnostic ( proj : ResolvedConfigFileName ) {
1444
1454
reportAndStoreErrors ( proj , [ configFileCache . getValue ( proj ) as Diagnostic ] ) ;
1445
1455
}
0 commit comments