4

I have these lazy chunk files during build production. There are many lazy chunk file, why are the name part empty ?

lazy chunk file

sample of lazy load module defined in routing module

  {
    path: 'learning-path',
    loadChildren: () => import('../dashboard/learning-path/learning-path.module').then(m =>m.LearningPathModule) 
  },
  {
    path: 'account',
    loadChildren: () => import('../dashboard/account/account.module').then(m =>m.AccountModule) 
  },
  {
    path: 'calendar',
    loadChildren: () => import('../dashboard/calendar/calendar.module').then(m =>m.CalendarModule) 
  },
  {
    path: 'coaches',
    loadChildren: () => import('../dashboard/coaches/coaches.module').then(m =>m.CoachesModule) 
  },
  {
    path: 'schedule-calendar',
    loadChildren: () => import('../dashboard/schedule-calendar/schedule-calendar.module').then(m =>m.ScheduleCalendarModule) 
  },
  {
    path: 'schedule-sessions',
    loadChildren: () => import('../dashboard/schedule-session/schedule-session.module').then(m =>m.ScheduleSessionModule) 
  },
2
  • Do you have internationalisation set up? Commented Feb 17, 2022 at 15:28
  • No. but angular universal Commented Feb 17, 2022 at 15:54

2 Answers 2

3
  • Navigate to angular.json file
  • Navigate -> projects -> -> architect -> build -> configuration -> e.g Production, development, staging -> set true for named chunk in order to show named lazy chunk file
"build": {
          "builder": "@angular-devkit/build-angular:browser",
          ...
          "configurations": {
            "production": {
               ...
              "namedChunks": true,
              ...
            }
          }
        }
Sign up to request clarification or add additional context in comments.

Comments

1

Most likely you are not using the flag namedChunks while building or serving your application.

Note that you can directly add the flag to your angular.json file or if you have a custom script in your package.json file you can simply add it to your settings:

IE:

...
"scripts": {
  "build-custom": "npm run build --configuration=production --aot=true --named-chunks=true --source-map=true
}
...

2 Comments

With this command I am able to see file name on left column but the Name column is still blank and its same like the name column in screenshot.
Like most build options, this can be put in angular.json. You can find it in projects/<projectname>/architect/build/options/"namedChunks": true (as @khizer 's answer states)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.