@@ -139,6 +139,7 @@ function ensureInstance(webpack: IWebPack, options: ICompilerOptions, instanceNa
139
139
try {
140
140
tsImpl = require ( compilerName ) ;
141
141
} catch ( e ) {
142
+ console . error ( e )
142
143
console . error ( COMPILER_ERROR ) ;
143
144
process . exit ( 1 ) ;
144
145
}
@@ -163,6 +164,8 @@ function ensureInstance(webpack: IWebPack, options: ICompilerOptions, instanceNa
163
164
164
165
let configFileName = tsImpl . findConfigFile ( options . tsconfig || process . cwd ( ) ) ;
165
166
let configFile = null ;
167
+
168
+ let tsConfigFiles = [ ] ;
166
169
if ( configFileName ) {
167
170
configFile = tsImpl . readConfigFile ( configFileName ) ;
168
171
if ( configFile . error ) {
@@ -171,6 +174,7 @@ function ensureInstance(webpack: IWebPack, options: ICompilerOptions, instanceNa
171
174
if ( configFile . config ) {
172
175
_ . extend ( options , configFile . config . compilerOptions ) ;
173
176
_ . extend ( options , configFile . config . awesomeTypescriptLoaderOptions ) ;
177
+ tsConfigFiles = configFile . config . files || tsConfigFiles ;
174
178
}
175
179
}
176
180
@@ -229,6 +233,15 @@ function ensureInstance(webpack: IWebPack, options: ICompilerOptions, instanceNa
229
233
options . externals = [ ] ;
230
234
}
231
235
236
+ if ( configFileName ) {
237
+ let configFilePath = path . dirname ( configFileName ) ;
238
+ options . externals = options . externals . concat (
239
+ tsConfigFiles
240
+ . filter ( file => / \. d \. t s $ / . test ( file ) )
241
+ . map ( file => path . resolve ( configFilePath , file ) )
242
+ )
243
+ }
244
+
232
245
if ( options . target ) {
233
246
options . target = helpers . parseOptionTarget ( < any > options . target , tsImpl ) ;
234
247
}
@@ -245,8 +258,6 @@ function ensureInstance(webpack: IWebPack, options: ICompilerOptions, instanceNa
245
258
246
259
let cacheIdentifier = null ;
247
260
if ( options . useCache ) {
248
- console . log ( webpack . query ) ;
249
-
250
261
if ( ! options . cacheDirectory ) {
251
262
options . cacheDirectory = path . join ( process . cwd ( ) , '.awcache' ) ;
252
263
}
0 commit comments