no chunks created when lazy loading...
See original GitHub issueproblem
I am using ng-cli with lazy loading:
...
{path: 'studioweb', pathMatch: 'full', redirectTo: '/App1/Dashboard'}, // IE/FF compatibility
{
path: 'App1', component: Appwrap,
children: [
{path: '', component: Appwrap, canActivate: [AuthService]},
{path: 'Dashboard', component: Dashboard, data: {title: 'Dashboard'}, canActivate: [AuthService]},
{path: 'Campaigns', loadChildren: '../app/campaigns/index#CampaignsLazyModule', data: {title: 'Campaigns'}, canActivate: [AuthService]},
{path: 'Fasterq', loadChildren: '../app/fasterq/index#FasterqLazyModule', data: {title: 'Fasterq'}, canActivate: [AuthService]},
...
I generate the build dist with:
ng build --target=production --base-href ./
and I don’t see any chunks. and while all “seems” to work, I am not sure lazy loading is working, almost as if Webpack bundles it all in?!?!?!
How can I confirm if lazy loading is working? Why are chunks not created? bug?
OS?
angular-cli: 1.0.0-beta.25.5 node: 6.5.0 os: win32 x64 @angular/common: 2.4.4 @angular/compiler: 2.4.4 @angular/core: 2.4.4 @angular/forms: 2.4.4 @angular/http: 2.4.4 @angular/language-service: 2.4.4 @angular/platform-browser: 2.4.4 @angular/platform-browser-dynamic: 2.4.4 @angular/router: 3.2.1 @angular/compiler-cli: 2.4.4
snap:
Angular 2 Kitchen sink: http://ng2.javascriptninja.io and source@ https://github.com/born2net/Angular-kitchen-sink Regards,
Sean
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Lazy Loading, no chunks - Angular 7 - Stack Overflow
I'm trying to do Lazy Loading, and followed the steps in the official docs of angular. The problem is that there is no...
Read more >Common Chunk and Lazy Loading in Angular - | juri.dev
What we're going to look at in this article is lazy loading in Angular, but in specific about the “common chunk” and the...
Read more >Webpack lazy-loading chunks - CodeX Team
Webpack supports splitting files to separate modules out of a box. This note will show you how to start using Webpack chunks and...
Read more >Lazy Loading | webpack
The code there does cause a separate chunk, lodash.bundle.js , to be generated and technically "lazy-loads" it as soon as the script is...
Read more >Lazy Loading Guide - Spartacus Documentation - SAP
Lazy loading, also known as code splitting, lets you divide your JavaScript code into multiple chunks. The result is that you do not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
that issue is closed… please advise … also I don’t believe its the same issue. that bug indicates lazy loading not working, I am not sure if its working or not but chunks are not being created
In my case, I remove the lazy load module from “imports” in app.module.ts and it’s solved.