@@ -228,19 +228,21 @@ export class AotPlugin implements Tapable {
228
228
cb ( ) ;
229
229
} ) ;
230
230
231
- // Virtual file system.
232
- compiler . resolvers . normal . plugin ( 'resolve' , ( request : any , cb ?: ( err ?: any ) => void ) => {
233
- if ( request . request . match ( / \. t s $ / ) ) {
234
- this . done . then ( ( ) => cb ( ) , ( ) => cb ( ) ) ;
235
- } else {
236
- cb ( ) ;
237
- }
231
+ compiler . plugin ( 'after-resolvers' , ( compiler : any ) => {
232
+ // Virtual file system.
233
+ compiler . resolvers . normal . plugin ( 'before-resolve' , ( request : any , cb : ( ) => void ) => {
234
+ if ( request . request . match ( / \. t s $ / ) ) {
235
+ this . done . then ( ( ) => cb ( ) , ( ) => cb ( ) ) ;
236
+ } else {
237
+ cb ( ) ;
238
+ }
239
+ } ) ;
240
+ compiler . resolvers . normal . apply ( new PathsPlugin ( {
241
+ tsConfigPath : this . _tsConfigPath ,
242
+ compilerOptions : this . _compilerOptions ,
243
+ compilerHost : this . _compilerHost
244
+ } ) ) ;
238
245
} ) ;
239
- compiler . resolvers . normal . apply ( new PathsPlugin ( {
240
- tsConfigPath : this . _tsConfigPath ,
241
- compilerOptions : this . _compilerOptions ,
242
- compilerHost : this . _compilerHost
243
- } ) ) ;
244
246
}
245
247
246
248
private _make ( compilation : any , cb : ( err ?: any , request ?: any ) => void ) {
0 commit comments