@@ -82,7 +82,6 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
82
82
let ignoreDiagnostics : { [ id : number ] : boolean } = { } ;
83
83
let instanceName : string ;
84
84
let context : string ;
85
- let getCustomTransformers : ( ) => ts . CustomTransformers | undefined ;
86
85
87
86
function ensureFile ( fileName : string ) {
88
87
if ( ! files [ fileName ] ) {
@@ -137,7 +136,6 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
137
136
138
137
class Host implements ts . LanguageServiceHost {
139
138
filesRegex : RegExp ;
140
- getCustomTransformers = getCustomTransformers ;
141
139
142
140
constructor ( filesRegex : RegExp ) {
143
141
this . filesRegex = filesRegex ;
@@ -240,10 +238,6 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
240
238
compilerInfo = payload . compilerInfo ;
241
239
loaderConfig = payload . loaderConfig ;
242
240
243
- if ( loaderConfig . customTranformersPath !== undefined ) {
244
- getCustomTransformers = require ( loaderConfig . customTranformersPath )
245
- }
246
-
247
241
compilerConfig = payload . compilerConfig ;
248
242
compilerOptions = compilerConfig . options ;
249
243
webpackOptions = payload . webpackOptions ;
@@ -268,8 +262,12 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
268
262
} ;
269
263
} ) ;
270
264
271
-
272
265
const program = service . getProgram ( ) ;
266
+
267
+ if ( loaderConfig . customTranformersPath !== undefined ) {
268
+ host . getCustomTransformers = require ( loaderConfig . customTranformersPath ) ( program ) ;
269
+ }
270
+
273
271
program . getSourceFiles ( ) . forEach ( file => {
274
272
files [ file . fileName ] = {
275
273
text : file . text ,
0 commit comments