@@ -675,7 +675,7 @@ namespace ts {
675
675
name : "out" ,
676
676
type : "string" ,
677
677
affectsEmit : true ,
678
- isFilePath : false , // This is intentionally broken to support compatability with existing tsconfig files
678
+ isFilePath : false , // This is intentionally broken to support compatibility with existing tsconfig files
679
679
// for correct behaviour, please use outFile
680
680
category : Diagnostics . Advanced_Options ,
681
681
paramType : Diagnostics . FILE ,
@@ -2056,8 +2056,20 @@ namespace ts {
2056
2056
Debug . assert ( ( json === undefined && sourceFile !== undefined ) || ( json !== undefined && sourceFile === undefined ) ) ;
2057
2057
const errors : Diagnostic [ ] = [ ] ;
2058
2058
2059
+ function makeFilesAbsolute ( optionsFromCLI : CompilerOptions ) {
2060
+ Object . keys ( optionsFromCLI ) . forEach ( key => {
2061
+ const optionForKey = getOptionDeclarationFromName ( getOptionNameMap , key , /*allowShort*/ true ) ;
2062
+ const value = optionsFromCLI [ key ] ;
2063
+ const relative = isString ( value ) && ! isRootedDiskPath ( value ) ;
2064
+ if ( relative && optionForKey && optionForKey . isFilePath && configFileName ) {
2065
+ optionsFromCLI [ key ] = getNormalizedAbsolutePath ( value as string , getDirectoryPath ( configFileName ) ) ;
2066
+ }
2067
+ } ) ;
2068
+ }
2069
+
2059
2070
const parsedConfig = parseConfig ( json , sourceFile , host , basePath , configFileName , resolutionStack , errors , extendedConfigCache ) ;
2060
2071
const { raw } = parsedConfig ;
2072
+ makeFilesAbsolute ( existingOptions ) ;
2061
2073
const options = extend ( existingOptions , parsedConfig . options || { } ) ;
2062
2074
options . configFilePath = configFileName && normalizeSlashes ( configFileName ) ;
2063
2075
setConfigFileInOptions ( options , sourceFile ) ;
0 commit comments