2

I'm developing Angular v8 app with using Angular CLI v8.

I have dashboard.module.ts

And after executing command ng-build I see in dist folder files with names:

dashboard-dashboard-module.js

Why not dashboard-module.js?

Why it's duplicate dashboard-dashboard?

What's the reason of naming it such way? Or it's default behavior?

A. Gladkiy
  • 3,134
  • 5
  • 38
  • 82
  • 1
    Possible duplicate of [Javascript .map files - javascript source maps](https://stackoverflow.com/questions/21719562/javascript-map-files-javascript-source-maps) – xandermonkey Sep 25 '19 at 13:00

2 Answers2

3

The name of your chunk is built following this pattern: {ModuleDirectoryName}-{ModuleName}.js

So if your module path looks like dashboard/dashboard.module.ts, the built chunk will be named dashboard-dashboard-module.js

If you want to change the naming pattern, one possibility is to use the webpack Plugin angular-named-lazy-chunks-webpack-plugin.

S. Spindler
  • 546
  • 3
  • 12
0

I found the same issue, a work around is modify your dashboard.module.ts into module.ts

Yi Yang
  • 85
  • 2