@@ -7,7 +7,6 @@ const path = require('path');
77const fs = require ( 'fs-extra' ) ;
88const resolve = require ( 'resolve' ) ;
99const compile = require ( '../utilities/compile' ) ;
10- const ts = require ( 'typescript' ) ;
1110const TypescriptOutput = require ( './typescript-output-plugin' ) ;
1211const CompilerState = require ( './compiler-state' ) ;
1312
@@ -28,6 +27,7 @@ module.exports = class IncrementalTypescriptCompiler {
2827 this . addons = this . _discoverAddons ( project , [ ] ) ;
2928 this . state = new CompilerState ( ) ;
3029
30+ this . _ts = project . require ( 'typescript' ) ;
3131 this . _watchProgram = null ;
3232 }
3333
@@ -125,10 +125,10 @@ module.exports = class IncrementalTypescriptCompiler {
125125 }
126126
127127 _formatDiagnosticMessage ( diagnostic ) {
128- return ts . formatDiagnostic ( diagnostic , {
128+ return this . _ts . formatDiagnostic ( diagnostic , {
129129 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 ,
132132 } ) ;
133133 }
134134
0 commit comments