@@ -1825,7 +1825,8 @@ namespace ts {
1825
1825
const options = extend ( existingOptions , parsedConfig . options || { } ) ;
1826
1826
options . configFilePath = configFileName && normalizeSlashes ( configFileName ) ;
1827
1827
setConfigFileInOptions ( options , sourceFile ) ;
1828
- const { fileNames, wildcardDirectories, spec, projectReferences } = getFileNames ( ) ;
1828
+ let projectReferences : ProjectReference [ ] | undefined ;
1829
+ const { fileNames, wildcardDirectories, spec } = getFileNames ( ) ;
1829
1830
return {
1830
1831
options,
1831
1832
fileNames,
@@ -1891,21 +1892,19 @@ namespace ts {
1891
1892
1892
1893
if ( hasProperty ( raw , "references" ) && ! isNullOrUndefined ( raw . references ) ) {
1893
1894
if ( isArray ( raw . references ) ) {
1894
- const references : ProjectReference [ ] = [ ] ;
1895
1895
for ( const ref of raw . references ) {
1896
1896
if ( typeof ref . path !== "string" ) {
1897
1897
createCompilerDiagnosticOnlyIfJson ( Diagnostics . Compiler_option_0_requires_a_value_of_type_1 , "reference.path" , "string" ) ;
1898
1898
}
1899
1899
else {
1900
- references . push ( {
1900
+ ( projectReferences || ( projectReferences = [ ] ) ) . push ( {
1901
1901
path : getNormalizedAbsolutePath ( ref . path , basePath ) ,
1902
1902
originalPath : ref . path ,
1903
1903
prepend : ref . prepend ,
1904
1904
circular : ref . circular
1905
1905
} ) ;
1906
1906
}
1907
1907
}
1908
- result . projectReferences = references ;
1909
1908
}
1910
1909
else {
1911
1910
createCompilerDiagnosticOnlyIfJson ( Diagnostics . Compiler_option_0_requires_a_value_of_type_1 , "references" , "Array" ) ;
@@ -2398,7 +2397,7 @@ namespace ts {
2398
2397
// new entries in these paths.
2399
2398
const wildcardDirectories = getWildcardDirectories ( validatedIncludeSpecs , validatedExcludeSpecs , basePath , host . useCaseSensitiveFileNames ) ;
2400
2399
2401
- const spec : ConfigFileSpecs = { filesSpecs, referencesSpecs : undefined , includeSpecs, excludeSpecs, validatedIncludeSpecs, validatedExcludeSpecs, wildcardDirectories } ;
2400
+ const spec : ConfigFileSpecs = { filesSpecs, includeSpecs, excludeSpecs, validatedIncludeSpecs, validatedExcludeSpecs, wildcardDirectories } ;
2402
2401
return getFileNamesFromConfigSpecs ( spec , basePath , options , host , extraFileExtensions ) ;
2403
2402
}
2404
2403
@@ -2469,16 +2468,9 @@ namespace ts {
2469
2468
2470
2469
const literalFiles = arrayFrom ( literalFileMap . values ( ) ) ;
2471
2470
const wildcardFiles = arrayFrom ( wildcardFileMap . values ( ) ) ;
2472
- const projectReferences = spec . referencesSpecs && spec . referencesSpecs . map ( ( r ) : ProjectReference => {
2473
- return {
2474
- ...r ,
2475
- path : getNormalizedAbsolutePath ( r . path , basePath )
2476
- } ;
2477
- } ) ;
2478
2471
2479
2472
return {
2480
2473
fileNames : literalFiles . concat ( wildcardFiles ) ,
2481
- projectReferences,
2482
2474
wildcardDirectories,
2483
2475
spec
2484
2476
} ;
0 commit comments