@@ -98,10 +98,11 @@ export class Compiler implements Emitter {
98
98
}
99
99
100
100
const tsconf = this . typescriptConfig ! ;
101
+ const pi = this . options . projectInfo ;
101
102
102
103
const prog = ts . createProgram ( {
103
104
rootNames : this . rootFiles . concat ( _pathOfLibraries ( this . compilerHost ) ) ,
104
- options : COMPILER_OPTIONS ,
105
+ options : { ... pi . tsc , ... COMPILER_OPTIONS } ,
105
106
// Make the references absolute for the compiler
106
107
projectReferences : tsconf . references && tsconf . references . map ( ref => ( { path : path . resolve ( ref . path ) } ) ) ,
107
108
host : this . compilerHost
@@ -115,10 +116,15 @@ export class Compiler implements Emitter {
115
116
*/
116
117
private async _startWatch ( ) : Promise < never > {
117
118
return new Promise < never > ( async ( ) => {
118
- const projectRoot = this . options . projectInfo . projectRoot ;
119
+ const pi = this . options . projectInfo ;
120
+ const projectRoot = pi . projectRoot ;
119
121
const host = ts . createWatchCompilerHost (
120
122
this . configPath ,
121
- { ...COMPILER_OPTIONS , noEmitOnError : false } ,
123
+ {
124
+ ...pi . tsc ,
125
+ ...COMPILER_OPTIONS ,
126
+ noEmitOnError : false ,
127
+ } ,
122
128
{ ...ts . sys , getCurrentDirectory ( ) { return projectRoot ; } }
123
129
) ;
124
130
if ( ! host . getDefaultLibLocation ) {
@@ -180,8 +186,11 @@ export class Compiler implements Emitter {
180
186
composite = true ;
181
187
}
182
188
189
+ const pi = this . options . projectInfo ;
190
+
183
191
this . typescriptConfig = {
184
192
compilerOptions : {
193
+ ...pi . tsc ,
185
194
...COMPILER_OPTIONS ,
186
195
composite,
187
196
// Need to stip the `lib.` prefix and `.d.ts` suffix
@@ -191,8 +200,8 @@ export class Compiler implements Emitter {
191
200
target : COMPILER_OPTIONS . target && ts . ScriptTarget [ COMPILER_OPTIONS . target ] ,
192
201
jsx : COMPILER_OPTIONS . jsx && Case . snake ( ts . JsxEmit [ COMPILER_OPTIONS . jsx ] ) ,
193
202
} ,
194
- include : [ "**/*.ts" ] ,
195
- exclude : [ "node_modules" ] . concat ( this . options . projectInfo . excludeTypescript ) ,
203
+ include : [ pi . tsc && pi . tsc . rootDir ? ` ${ pi . tsc . rootDir } /**/*.ts` : "**/*.ts" ] ,
204
+ exclude : [ "node_modules" ] . concat ( pi . excludeTypescript ) ,
196
205
// Change the references a little. We write 'originalpath' to the
197
206
// file under the 'path' key, which is the same as what the
198
207
// TypeScript compiler does. Make it relative so that the files are
0 commit comments