@@ -843,14 +843,18 @@ namespace ts {
843
843
return buildHost . message ( Diagnostics . A_non_dry_build_would_build_project_0 , proj . options . configFilePath ! ) ;
844
844
}
845
845
846
- if ( context . options . verbose ) buildHost . verbose ( Diagnostics . Updating_output_timestamps_of_project_0 , proj . options . configFilePath ! ) ;
846
+ if ( context . options . verbose ) {
847
+ buildHost . verbose ( Diagnostics . Updating_output_timestamps_of_project_0 , proj . options . configFilePath ! ) ;
848
+ }
849
+
847
850
const now = new Date ( ) ;
848
851
const outputs = getAllProjectOutputs ( proj ) ;
849
852
let priorNewestUpdateTime = minimumDate ;
850
853
for ( const file of outputs ) {
851
854
if ( isDeclarationFile ( file ) ) {
852
- priorNewestUpdateTime = newer ( priorNewestUpdateTime , compilerHost . getModifiedTime ! ( file ) ) ;
855
+ priorNewestUpdateTime = newer ( priorNewestUpdateTime , compilerHost . getModifiedTime ! ( file ) || missingFileModifiedTime ) ;
853
856
}
857
+
854
858
compilerHost . setModifiedTime ! ( file , now ) ;
855
859
}
856
860
@@ -1057,7 +1061,7 @@ namespace ts {
1057
1061
} ;
1058
1062
}
1059
1063
1060
- const inputTime = host . getModifiedTime ( inputFile ) ;
1064
+ const inputTime = host . getModifiedTime ( inputFile ) || missingFileModifiedTime ;
1061
1065
if ( inputTime > newestInputFileTime ) {
1062
1066
newestInputFileName = inputFile ;
1063
1067
newestInputFileTime = inputTime ;
@@ -1089,7 +1093,7 @@ namespace ts {
1089
1093
break ;
1090
1094
}
1091
1095
1092
- const outputTime = host . getModifiedTime ( output ) ;
1096
+ const outputTime = host . getModifiedTime ( output ) || missingFileModifiedTime ;
1093
1097
if ( outputTime < oldestOutputFileTime ) {
1094
1098
oldestOutputFileTime = outputTime ;
1095
1099
oldestOutputFileName = output ;
@@ -1117,7 +1121,8 @@ namespace ts {
1117
1121
newestDeclarationFileContentChangedTime = newer ( unchangedTime , newestDeclarationFileContentChangedTime ) ;
1118
1122
}
1119
1123
else {
1120
- newestDeclarationFileContentChangedTime = newer ( newestDeclarationFileContentChangedTime , host . getModifiedTime ( output ) ) ;
1124
+ const outputModifiedTime = host . getModifiedTime ( output ) || missingFileModifiedTime ;
1125
+ newestDeclarationFileContentChangedTime = newer ( newestDeclarationFileContentChangedTime , outputModifiedTime ) ;
1121
1126
}
1122
1127
}
1123
1128
}
0 commit comments