@@ -760,39 +760,36 @@ export class AngularCompilerPlugin {
760760 return result ;
761761 }
762762
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 ;
787781 }
782+ } )
783+ . filter ( x => ! ! x ) ;
788784
789- callback ( null , dependencies ) ;
790- } ;
785+ if ( this . _options . nameLazyFiles ) {
786+ options . chunkName = '[request]' ;
787+ }
791788
792- return result ;
793- } ,
794- ( ) => undefined ,
795- ) ;
789+ callback ( null , dependencies ) ;
790+ } ;
791+
792+ return result ;
796793 } ) ;
797794 } ) ;
798795 }
0 commit comments