I am using Angular7 and I am using the new syntax i.e. loadChildren for lazy loading modules. But When I serve my App and check in browser I see it does not create any chunks.
Below is my App-routing
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: '', loadChildren: './layout/layout.module#LayoutModule' },
{ path: 'auth', loadChildren: './auth/auth.module#AuthModule' },
{ path: 'not-found', loadChildren: './not-found/not-found.module#NotFoundModule' },
{ path: '**', redirectTo: 'not-found' }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Below is my App module i
mport { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
// imports for internationalization i18n
import { HttpClientModule } from '@angular/common/http';
import { LanguageTranslationModule } from './language-translation/language-translation.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
LanguageTranslationModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
As shown chunks are indeed created.
And not found module isn't appearing which is normal.