angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

no chunks created when lazy loading...

Open born2net opened this issue 9 years ago • 7 comments

problem

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:

nochunks

Angular 2 Kitchen sink: http://ng2.javascriptninja.io and source@ https://github.com/born2net/Angular-kitchen-sink Regards,

Sean

born2net avatar Jan 19 '17 19:01 born2net

Dupe of https://github.com/angular/angular-cli/issues/2496

filipesilva avatar Jan 19 '17 19:01 filipesilva

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

born2net avatar Jan 19 '17 19:01 born2net

looks like build .28-3 still does not generate any chunks for lazy loading

born2net avatar Feb 02 '17 20:02 born2net

Same with build .30. Lazy routes work fine, but no chunking.

eklee avatar Feb 10 '17 01:02 eklee

@born2net @eklee I had the same issue, but now it works with .31 perfectly

laserus avatar Feb 15 '17 11:02 laserus

In my case, I remove the lazy load module from "imports" in app.module.ts and it's solved.

mitsukikaminaga avatar Dec 14 '17 04:12 mitsukikaminaga

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.