Apply Route-level Code Splitting and Lazy Loading with the Angular CLI

preview_player
Показать описание
When our Angular web app grows, the initial bundle size increases and so does the Time to Interactive. One of the countermeasures we can apply to improve that is to apply code-splitting to our app and consequently to lazy load those bundles only when they are needed. In this lesson we will learn how to apply route-level code splitting via the Angular CLI.

Рекомендации по теме
Комментарии
Автор

Should be the default way to have all code in modules: One App Module and zero, one or many Feature Modules. A Module is a unit of compilation.

hansschenker
Автор

When we build for production, at enterprise level, we often deploy static files at a diff location.
But Angular will try loading the lazyloaded assets from '/', we could override this by providing deployUrl configuration .
However, at enterprise scale, lot of teams tend to build once and deploy in multiple environments like dev, test, pre-prod and prod, for these the assets path will be diff.
Is there a way you can suggest to configure deployUrl path for angular to load the lazy assets.

RajendrakumarVankadari