@@ -50,8 +50,15 @@ namespace ts {
50
50
51
51
Debug . assert ( commandLine . fileNames . length !== 0 || ! ! configFileName ) ;
52
52
53
+ const currentDirectory = sys . getCurrentDirectory ( ) ;
54
+ const getCanonicalFileName = createGetCanonicalFileName ( sys . useCaseSensitiveFileNames ) ;
55
+ const commandLineOptions = convertToOptionsWithAbsolutePaths (
56
+ commandLine . options ,
57
+ fileName => toPath ( fileName , currentDirectory , getCanonicalFileName )
58
+ ) ;
59
+
53
60
if ( configFileName ) {
54
- const configParseResult = Debug . assertDefined ( parseConfigFileWithSystem ( configFileName , commandLine . options , sys , reportDiagnostic ) ) ;
61
+ const configParseResult = Debug . assertDefined ( parseConfigFileWithSystem ( configFileName , commandLineOptions , sys , reportDiagnostic ) ) ;
55
62
if ( isIncrementalCompilation ( configParseResult . options ) ) {
56
63
performIncrementalCompilation ( sys , configParseResult ) ;
57
64
}
@@ -61,10 +68,16 @@ namespace ts {
61
68
}
62
69
else {
63
70
if ( isIncrementalCompilation ( commandLine . options ) ) {
64
- performIncrementalCompilation ( sys , commandLine ) ;
71
+ performIncrementalCompilation ( sys , {
72
+ ...commandLine ,
73
+ options : commandLineOptions
74
+ } ) ;
65
75
}
66
76
else {
67
- performCompilation ( sys , commandLine ) ;
77
+ performCompilation ( sys , {
78
+ ...commandLine ,
79
+ options : commandLineOptions
80
+ } ) ;
68
81
}
69
82
}
70
83
}
@@ -79,6 +92,7 @@ namespace ts {
79
92
const { fileNames, options, projectReferences } = config ;
80
93
const reportDiagnostic = createDiagnosticReporter ( sys , options . pretty ) ;
81
94
const host = createCompilerHostWorker ( options , /*setParentPos*/ undefined , sys ) ;
95
+ fakes . patchHostForBuildInfoReadWrite ( host ) ;
82
96
const currentDirectory = host . getCurrentDirectory ( ) ;
83
97
const getCanonicalFileName = createGetCanonicalFileName ( host . useCaseSensitiveFileNames ( ) ) ;
84
98
changeCompilerHostLikeToUseCache ( host , fileName => toPath ( fileName , currentDirectory , getCanonicalFileName ) ) ;
@@ -102,7 +116,10 @@ namespace ts {
102
116
function performIncrementalCompilation ( sys : TscCompileSystem , config : ParsedCommandLine ) {
103
117
const reportDiagnostic = createDiagnosticReporter ( sys , config . options . pretty ) ;
104
118
const { options, fileNames, projectReferences } = config ;
119
+ const host = createIncrementalCompilerHost ( options , sys ) ;
120
+ fakes . patchHostForBuildInfoReadWrite ( host ) ;
105
121
const exitCode = ts . performIncrementalCompilation ( {
122
+ host,
106
123
system : sys ,
107
124
rootNames : fileNames ,
108
125
options,
0 commit comments