@@ -7,7 +7,6 @@ const path = require('path');
7
7
const fs = require ( 'fs-extra' ) ;
8
8
const resolve = require ( 'resolve' ) ;
9
9
const compile = require ( '../utilities/compile' ) ;
10
- const ts = require ( 'typescript' ) ;
11
10
const TypescriptOutput = require ( './typescript-output-plugin' ) ;
12
11
const CompilerState = require ( './compiler-state' ) ;
13
12
@@ -28,6 +27,7 @@ module.exports = class IncrementalTypescriptCompiler {
28
27
this . addons = this . _discoverAddons ( project , [ ] ) ;
29
28
this . state = new CompilerState ( ) ;
30
29
30
+ this . _ts = project . require ( 'typescript' ) ;
31
31
this . _watchProgram = null ;
32
32
}
33
33
@@ -125,10 +125,10 @@ module.exports = class IncrementalTypescriptCompiler {
125
125
}
126
126
127
127
_formatDiagnosticMessage ( diagnostic ) {
128
- return ts . formatDiagnostic ( diagnostic , {
128
+ return this . _ts . formatDiagnostic ( diagnostic , {
129
129
getCanonicalFileName : path => path ,
130
- getCurrentDirectory : ts . sys . getCurrentDirectory ,
131
- getNewLine : ( ) => ts . sys . newLine ,
130
+ getCurrentDirectory : this . _ts . sys . getCurrentDirectory ,
131
+ getNewLine : ( ) => this . _ts . sys . newLine ,
132
132
} ) ;
133
133
}
134
134
0 commit comments