@@ -676,8 +676,9 @@ namespace ts {
676
676
const parsedRef = parseProjectReferenceConfigFile ( ref ) ;
677
677
resolvedProjectReferences ! . push ( parsedRef ) ;
678
678
if ( parsedRef ) {
679
- if ( parsedRef . commandLine . options . outFile ) {
680
- const dtsOutfile = changeExtension ( parsedRef . commandLine . options . outFile , ".d.ts" ) ;
679
+ const out = parsedRef . commandLine . options . outFile || parsedRef . commandLine . options . out ;
680
+ if ( out ) {
681
+ const dtsOutfile = changeExtension ( out , ".d.ts" ) ;
681
682
processSourceFile ( dtsOutfile , /*isDefaultLib*/ false , /*ignoreNoDefaultLib*/ false , /*packageId*/ undefined ) ;
682
683
}
683
684
addProjectReferenceRedirects ( parsedRef . commandLine , projectReferenceRedirects ) ;
@@ -1244,6 +1245,13 @@ namespace ts {
1244
1245
}
1245
1246
resolvedTypeReferenceDirectives = oldProgram . getResolvedTypeReferenceDirectives ( ) ;
1246
1247
resolvedProjectReferences = oldProgram . getResolvedProjectReferences ( ) ;
1248
+ if ( resolvedProjectReferences ) {
1249
+ resolvedProjectReferences . forEach ( ref => {
1250
+ if ( ref ) {
1251
+ addProjectReferenceRedirects ( ref . commandLine , projectReferenceRedirects ) ;
1252
+ }
1253
+ } ) ;
1254
+ }
1247
1255
1248
1256
sourceFileToPackageName = oldProgram . sourceFileToPackageName ;
1249
1257
redirectTargetsMap = oldProgram . redirectTargetsMap ;
@@ -1299,12 +1307,13 @@ namespace ts {
1299
1307
const ref = projectReferences [ i ] ;
1300
1308
const resolvedRefOpts = resolvedProjectReferences ! [ i ] ! . commandLine ;
1301
1309
if ( ref . prepend && resolvedRefOpts && resolvedRefOpts . options ) {
1310
+ const out = resolvedRefOpts . options . outFile || resolvedRefOpts . options . out ;
1302
1311
// Upstream project didn't have outFile set -- skip (error will have been issued earlier)
1303
- if ( ! resolvedRefOpts . options . outFile ) continue ;
1312
+ if ( ! out ) continue ;
1304
1313
1305
- const dtsFilename = changeExtension ( resolvedRefOpts . options . outFile , ".d.ts" ) ;
1306
- const js = host . readFile ( resolvedRefOpts . options . outFile ) || `/* Input file ${ resolvedRefOpts . options . outFile } was missing */\r\n` ;
1307
- const jsMapPath = resolvedRefOpts . options . outFile + ".map" ; // TODO: try to read sourceMappingUrl comment from the file
1314
+ const dtsFilename = changeExtension ( out , ".d.ts" ) ;
1315
+ const js = host . readFile ( out ) || `/* Input file ${ out } was missing */\r\n` ;
1316
+ const jsMapPath = out + ".map" ; // TODO: try to read sourceMappingUrl comment from the file
1308
1317
const jsMap = host . readFile ( jsMapPath ) ;
1309
1318
const dts = host . readFile ( dtsFilename ) || `/* Input file ${ dtsFilename } was missing */\r\n` ;
1310
1319
const dtsMapPath = dtsFilename + ".map" ;
@@ -2446,9 +2455,10 @@ namespace ts {
2446
2455
createDiagnosticForReference ( i , Diagnostics . Referenced_project_0_must_have_setting_composite_Colon_true , ref . path ) ;
2447
2456
}
2448
2457
if ( ref . prepend ) {
2449
- if ( resolvedRefOpts . outFile ) {
2450
- if ( ! host . fileExists ( resolvedRefOpts . outFile ) ) {
2451
- createDiagnosticForReference ( i , Diagnostics . Output_file_0_from_project_1_does_not_exist , resolvedRefOpts . outFile , ref . path ) ;
2458
+ const out = resolvedRefOpts . outFile || resolvedRefOpts . out ;
2459
+ if ( out ) {
2460
+ if ( ! host . fileExists ( out ) ) {
2461
+ createDiagnosticForReference ( i , Diagnostics . Output_file_0_from_project_1_does_not_exist , out , ref . path ) ;
2452
2462
}
2453
2463
}
2454
2464
else {
0 commit comments