@@ -682,7 +682,7 @@ namespace ts {
682
682
683
683
interface UpdateBundleProject extends InvalidatedProjectBase {
684
684
readonly kind : InvalidatedProjectKind . UpdateBundle ;
685
- updateBundle ( cancellationToken ?: CancellationToken ) : BuildResultFlags ;
685
+ updateBundle ( ) : BuildResultFlags | BuildInvalidedProject ;
686
686
}
687
687
688
688
type InvalidatedProject = UpdateOutputFileStampsProject | BuildInvalidedProject | UpdateBundleProject ;
@@ -749,13 +749,21 @@ namespace ts {
749
749
projectPath,
750
750
updateBundle : update ,
751
751
done : cancellationToken => {
752
- if ( updatePending ) update ( cancellationToken ) ;
752
+ if ( updatePending ) {
753
+ const result = update ( ) ;
754
+ if ( ( result as BuildInvalidedProject ) . project ) {
755
+ return ( result as BuildInvalidedProject ) . done ( cancellationToken ) ;
756
+ }
757
+ }
753
758
state . projectPendingBuild . delete ( projectPath ) ;
754
759
}
755
760
} ;
756
761
757
- function update ( cancellationToken ?: CancellationToken ) {
758
- const buildResult = updateBundle ( state , project , projectPath , config , cancellationToken ) ;
762
+ function update ( ) {
763
+ const buildResult = updateBundle ( state , project , projectPath , config ) ;
764
+ if ( isString ( buildResult ) ) {
765
+ return createBuildInvalidedProject ( state , project , projectPath , projectIndex , config , buildOrder ) ;
766
+ }
759
767
queueReferencingProjects ( state , project , projectPath , projectIndex , config , buildOrder , buildResult ) ;
760
768
updatePending = false ;
761
769
return buildResult ;
@@ -1068,9 +1076,8 @@ namespace ts {
1068
1076
state : SolutionBuilderState ,
1069
1077
proj : ResolvedConfigFileName ,
1070
1078
resolvedPath : ResolvedConfigFilePath ,
1071
- config : ParsedCommandLine ,
1072
- cancellationToken : CancellationToken | undefined
1073
- ) : BuildResultFlags {
1079
+ config : ParsedCommandLine
1080
+ ) : BuildResultFlags | string {
1074
1081
if ( state . options . dry ) {
1075
1082
reportStatus ( state , Diagnostics . A_non_dry_build_would_update_output_of_project_0 , proj ) ;
1076
1083
return BuildResultFlags . Success ;
@@ -1090,7 +1097,7 @@ namespace ts {
1090
1097
} ) ;
1091
1098
if ( isString ( outputFiles ) ) {
1092
1099
reportStatus ( state , Diagnostics . Cannot_update_output_of_project_0_because_there_was_error_reading_file_1 , proj , relName ( state , outputFiles ) ) ;
1093
- return buildSingleProject ( state , proj , resolvedPath , config , cancellationToken ) ;
1100
+ return outputFiles ;
1094
1101
}
1095
1102
1096
1103
// Actual Emit
0 commit comments