Performance: Bundle size analysis
HIGH IMPACT
This affects the page load speed by determining how much code the browser must download and parse before rendering the app.
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule], bootstrap: [AppComponent] }) export class AppModule {} // Lazy load HeavyLibraryModule only when needed in a feature module or route
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { HeavyLibraryModule } from 'heavy-library'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, HeavyLibraryModule], bootstrap: [AppComponent] }) export class AppModule {}
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large monolithic bundle | Minimal | Minimal | High due to delayed rendering | [X] Bad |
| Lazy loaded feature modules | Minimal | Minimal | Lower due to faster initial render | [OK] Good |