@@ -276,60 +276,6 @@ namespace ts {
276
276
return getOrCreateValueFromConfigFileMap < Map < T > > ( configFileMap , resolved , createMap ) ;
277
277
}
278
278
279
- export function getOutputDeclarationFileName ( inputFileName : string , configFile : ParsedCommandLine ) {
280
- const relativePath = getRelativePathFromDirectory ( rootDirOfOptions ( configFile . options , configFile . options . configFilePath ! ) , inputFileName , /*ignoreCase*/ true ) ;
281
- const outputPath = resolvePath ( configFile . options . declarationDir || configFile . options . outDir || getDirectoryPath ( configFile . options . configFilePath ! ) , relativePath ) ;
282
- return changeExtension ( outputPath , Extension . Dts ) ;
283
- }
284
-
285
- function getOutputJSFileName ( inputFileName : string , configFile : ParsedCommandLine ) {
286
- const relativePath = getRelativePathFromDirectory ( rootDirOfOptions ( configFile . options , configFile . options . configFilePath ! ) , inputFileName , /*ignoreCase*/ true ) ;
287
- const outputPath = resolvePath ( configFile . options . outDir || getDirectoryPath ( configFile . options . configFilePath ! ) , relativePath ) ;
288
- const newExtension = fileExtensionIs ( inputFileName , Extension . Json ) ? Extension . Json :
289
- fileExtensionIs ( inputFileName , Extension . Tsx ) && configFile . options . jsx === JsxEmit . Preserve ? Extension . Jsx : Extension . Js ;
290
- return changeExtension ( outputPath , newExtension ) ;
291
- }
292
-
293
- function getOutputFileNames ( inputFileName : string , configFile : ParsedCommandLine ) : ReadonlyArray < string > {
294
- // outFile is handled elsewhere; .d.ts files don't generate outputs
295
- if ( configFile . options . outFile || configFile . options . out || fileExtensionIs ( inputFileName , Extension . Dts ) ) {
296
- return emptyArray ;
297
- }
298
-
299
- const outputs : string [ ] = [ ] ;
300
- const js = getOutputJSFileName ( inputFileName , configFile ) ;
301
- outputs . push ( js ) ;
302
- if ( configFile . options . sourceMap ) {
303
- outputs . push ( `${ js } .map` ) ;
304
- }
305
- if ( getEmitDeclarations ( configFile . options ) && ! fileExtensionIs ( inputFileName , Extension . Json ) ) {
306
- const dts = getOutputDeclarationFileName ( inputFileName , configFile ) ;
307
- outputs . push ( dts ) ;
308
- if ( configFile . options . declarationMap ) {
309
- outputs . push ( `${ dts } .map` ) ;
310
- }
311
- }
312
- return outputs ;
313
- }
314
-
315
- function getOutFileOutputs ( project : ParsedCommandLine , ignoreBuildInfo ?: boolean ) : ReadonlyArray < string > {
316
- Debug . assert ( ! ! project . options . outFile || ! ! project . options . out , "outFile must be set" ) ;
317
- const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle ( project . options , /*forceDtsPaths*/ false ) ;
318
-
319
- let outputs : string [ ] | undefined = [ ] ;
320
- const addOutput = ( path : string | undefined ) => path && ( outputs || ( outputs = [ ] ) ) . push ( path ) ;
321
- addOutput ( jsFilePath ) ;
322
- addOutput ( sourceMapFilePath ) ;
323
- addOutput ( declarationFilePath ) ;
324
- addOutput ( declarationMapPath ) ;
325
- if ( ! ignoreBuildInfo ) addOutput ( buildInfoPath ) ;
326
- return outputs || emptyArray ;
327
- }
328
-
329
- function rootDirOfOptions ( opts : CompilerOptions , configFileName : string ) {
330
- return opts . rootDir || getDirectoryPath ( configFileName ) ;
331
- }
332
-
333
279
function newer ( date1 : Date , date2 : Date ) : Date {
334
280
return date2 > date1 ? date2 : date1 ;
335
281
}
@@ -715,7 +661,7 @@ namespace ts {
715
661
}
716
662
717
663
// Collect the expected outputs of this project
718
- const outputs = getAllProjectOutputs ( project ) ;
664
+ const outputs = getAllProjectOutputs ( project , ! host . useCaseSensitiveFileNames ( ) ) ;
719
665
720
666
if ( outputs . length === 0 ) {
721
667
return {
@@ -1202,7 +1148,7 @@ namespace ts {
1202
1148
const status : Status . UpToDate = {
1203
1149
type : UpToDateStatusType . UpToDate ,
1204
1150
newestDeclarationFileContentChangedTime : anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime ,
1205
- oldestOutputFileName : outputFiles . length ? outputFiles [ 0 ] . name : getFirstProjectOutput ( configFile )
1151
+ oldestOutputFileName : outputFiles . length ? outputFiles [ 0 ] . name : getFirstProjectOutput ( configFile , ! host . useCaseSensitiveFileNames ( ) )
1206
1152
} ;
1207
1153
diagnostics . removeKey ( proj ) ;
1208
1154
projectStatus . setValue ( proj , status ) ;
@@ -1295,13 +1241,13 @@ namespace ts {
1295
1241
const status : Status . UpToDate = {
1296
1242
type : UpToDateStatusType . UpToDate ,
1297
1243
newestDeclarationFileContentChangedTime : priorNewestUpdateTime ,
1298
- oldestOutputFileName : getFirstProjectOutput ( proj )
1244
+ oldestOutputFileName : getFirstProjectOutput ( proj , ! host . useCaseSensitiveFileNames ( ) )
1299
1245
} ;
1300
1246
projectStatus . setValue ( proj . options . configFilePath as ResolvedConfigFilePath , status ) ;
1301
1247
}
1302
1248
1303
1249
function updateOutputTimestampsWorker ( proj : ParsedCommandLine , priorNewestUpdateTime : Date , verboseMessage : DiagnosticMessage , skipOutputs ?: FileMap < true > ) {
1304
- const outputs = getAllProjectOutputs ( proj ) ;
1250
+ const outputs = getAllProjectOutputs ( proj , ! host . useCaseSensitiveFileNames ( ) ) ;
1305
1251
if ( ! skipOutputs || outputs . length !== skipOutputs . getSize ( ) ) {
1306
1252
if ( options . verbose ) {
1307
1253
reportStatus ( verboseMessage , proj . options . configFilePath ! ) ;
@@ -1337,7 +1283,7 @@ namespace ts {
1337
1283
reportParseConfigFileDiagnostic ( proj ) ;
1338
1284
continue ;
1339
1285
}
1340
- const outputs = getAllProjectOutputs ( parsed ) ;
1286
+ const outputs = getAllProjectOutputs ( parsed , ! host . useCaseSensitiveFileNames ( ) ) ;
1341
1287
for ( const output of outputs ) {
1342
1288
if ( host . fileExists ( output ) ) {
1343
1289
filesToDelete . push ( output ) ;
@@ -1499,35 +1445,6 @@ namespace ts {
1499
1445
return combinePaths ( project , "tsconfig.json" ) as ResolvedConfigFileName ;
1500
1446
}
1501
1447
1502
- export function getAllProjectOutputs ( project : ParsedCommandLine ) : ReadonlyArray < string > {
1503
- if ( project . options . outFile || project . options . out ) {
1504
- return getOutFileOutputs ( project ) ;
1505
- }
1506
- else {
1507
- const outputs : string [ ] = [ ] ;
1508
- for ( const inputFile of project . fileNames ) {
1509
- outputs . push ( ...getOutputFileNames ( inputFile , project ) ) ;
1510
- }
1511
- const buildInfoPath = getOutputPathForBuildInfo ( project . options ) ;
1512
- if ( buildInfoPath ) outputs . push ( buildInfoPath ) ;
1513
- return outputs ;
1514
- }
1515
- }
1516
-
1517
- function getFirstProjectOutput ( project : ParsedCommandLine ) : string {
1518
- if ( project . options . outFile || project . options . out ) {
1519
- return first ( getOutFileOutputs ( project ) ) ;
1520
- }
1521
-
1522
- for ( const inputFile of project . fileNames ) {
1523
- const outputs = getOutputFileNames ( inputFile , project ) ;
1524
- if ( outputs . length ) {
1525
- return first ( outputs ) ;
1526
- }
1527
- }
1528
- return Debug . fail ( `project ${ project . options . configFilePath } expected to have at least one output` ) ;
1529
- }
1530
-
1531
1448
export function formatUpToDateStatus < T > ( configFileName : string , status : UpToDateStatus , relName : ( fileName : string ) => string , formatMessage : ( message : DiagnosticMessage , ...args : string [ ] ) => T ) {
1532
1449
switch ( status . type ) {
1533
1450
case UpToDateStatusType . OutOfDateWithSelf :
0 commit comments