I defined a lazy loading module.
this is SettingsRoutingModule module-
const routes: Routes = [
{
path: '',
component: SettingsStandaloneComponent,
children: [
{
path: '',
redirectTo: 'profile',
pathMatch: 'full'
},
{
path: 'profile',
component: SettingsProfileComponent
},
{
path: 'about',
component: SettingsAboutComponent
},
{
path: 'affiliations',
component: SettingsAffiliationsComponent
},
{
path: 'communication',
component: SettingsCommunicationComponent
},
{
path: 'notifications',
component: SettingsNotificationsComponent
},
{
path: 'proxies',
component: SettingsProxiesComponent
},
{
path: '**',
redirectTo: 'profile',
pathMatch: 'full'
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class SettingsRoutingModule { }
in the AppRoutingModule module-
{ path: 'settings',
loadChildren: './settings/settings.module#SettingsModule',
canActivate: [AuthGuard],
},
in the prod production when a go to the network I don't see the "chunk.js" that everybody say that should appear". only two files that looks like- 0.34016a93d44e785b623a.js
In my localhost I see only "settings-settings-module.js"
Is it OK or does it mean that my module isn't lazy?
Because of this option "namedChunks": false
in your angular.json, you won't see the named chunks anymore, instead it displays hashed-value as the file name. This is due to recent improvements(not sure from when) in angular/cli.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.