@@ -760,39 +760,36 @@ export class AngularCompilerPlugin {
760
760
return result ;
761
761
}
762
762
763
- return this . done . then (
764
- ( ) => {
765
- // This folder does not exist, but we need to give webpack a resource.
766
- // TODO: check if we can't just leave it as is (angularCoreModuleDir).
767
- result . resource = path . join ( this . _basePath , '$$_lazy_route_resource' ) ;
768
- // tslint:disable-next-line:no-any
769
- result . dependencies . forEach ( ( d : any ) => d . critical = false ) ;
770
- // tslint:disable-next-line:no-any
771
- result . resolveDependencies = ( _fs : any , options : any , callback : Callback ) => {
772
- const dependencies = Object . keys ( this . _lazyRoutes )
773
- . map ( ( key ) => {
774
- const modulePath = this . _lazyRoutes [ key ] ;
775
- if ( modulePath !== null ) {
776
- const name = key . split ( '#' ) [ 0 ] ;
777
-
778
- return new this . _contextElementDependencyConstructor ( modulePath , name ) ;
779
- } else {
780
- return null ;
781
- }
782
- } )
783
- . filter ( x => ! ! x ) ;
784
-
785
- if ( this . _options . nameLazyFiles ) {
786
- options . chunkName = '[request]' ;
763
+ await this . done ;
764
+
765
+ // This folder does not exist, but we need to give webpack a resource.
766
+ // TODO: check if we can't just leave it as is (angularCoreModuleDir).
767
+ result . resource = path . join ( this . _basePath , '$$_lazy_route_resource' ) ;
768
+ // tslint:disable-next-line:no-any
769
+ result . dependencies . forEach ( ( d : any ) => d . critical = false ) ;
770
+ // tslint:disable-next-line:no-any
771
+ result . resolveDependencies = ( _fs : any , options : any , callback : Callback ) => {
772
+ const dependencies = Object . keys ( this . _lazyRoutes )
773
+ . map ( ( key ) => {
774
+ const modulePath = this . _lazyRoutes [ key ] ;
775
+ if ( modulePath !== null ) {
776
+ const name = key . split ( '#' ) [ 0 ] ;
777
+
778
+ return new this . _contextElementDependencyConstructor ( modulePath , name ) ;
779
+ } else {
780
+ return null ;
787
781
}
782
+ } )
783
+ . filter ( x => ! ! x ) ;
788
784
789
- callback ( null , dependencies ) ;
790
- } ;
785
+ if ( this . _options . nameLazyFiles ) {
786
+ options . chunkName = '[request]' ;
787
+ }
791
788
792
- return result ;
793
- } ,
794
- ( ) => undefined ,
795
- ) ;
789
+ callback ( null , dependencies ) ;
790
+ } ;
791
+
792
+ return result ;
796
793
} ) ;
797
794
} ) ;
798
795
}
0 commit comments