Skip to content

no chunks created when lazy loading... #4121

Closed

Description

@born2net

problem

I am using ng-cli with lazy loading:

...
{path: 'studioweb', pathMatch: 'full', redirectTo: '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/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

Activity

  1. filipesilva commented on Jan 19, 2017

    @filipesilva
    Contributor

    Dupe of #2496

  2. born2net commented on Jan 19, 2017

    @born2net
    Author

    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

  3. born2net commented on Feb 2, 2017

    @born2net
    Author

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

  4. eklee commented on Feb 10, 2017

    @eklee

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

  5. laserus commented on Feb 15, 2017

    @laserus

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

  6. mitsukikaminaga commented on Dec 14, 2017

    @mitsukikaminaga

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

  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions