How do you configure a route for lazy loading?

Tests route-level code splitting and initial bundle control. Outline: dynamic imports in route config, on-demand chunk fetching, and measurable load-time wins versus eager loading. Red flag: treating lazy loading as just images or components, not route code.
Tests route-level code splitting and initial bundle control in large SPAs. A strong answer covers: first, dynamic imports in router config so each route becomes its own chunk; second, on-demand fetching on first navigation instead of upfront; third, quantifying impact, like reducing a multi-megabyte bundle to a shell plus small chunks; fourth, contrasting with eager loading. Red flag: confusing lazy loading with image deferral or component tricks without addressing route-boundary code splitting.
Read the original → angular.dev
- #lazy-loading
- #spa-performance
- #routing
- #code-splitting
- #bundle-optimization
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.