Stop Lazy Loading Routes.
Lazy loading entire pages (routes) is good, but it's not enough.
With @defer, you can lazy load individual components inside a page. Does the user need to load the Heavy Chart bundle if they haven't scrolled down yet? No.
02. Declarative Loading
Angular handles the code-splitting, chunk generation, and loading state management for you.
<heavy-chart />
{'}'}
<div>Loading Chart...</div>
{'}'}
<spinner />
{'}'}
<error-msg />
{'}'}
Deep Dive: Prefetching
You can separate the render trigger from the fetch trigger.
@defer (on interaction; prefetch on idle)
This downloads the JS bundle in the background when the browser is idle, so it's ready instantly when the user clicks.
04. The Senior Engineer's Take
LCP Optimization
Pro Tip: Wrap everything below the fold in @defer (on viewport).
This dramatically reduces the Initial Bundle Size and improves LCP (Largest Contentful Paint) because the browser prioritizes critical CSS/JS for the header.