A. Gladkiy
A. Gladkiy

Reputation: 3450

angular cli duplicate chunk name after ng build

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?

Upvotes: 2

Views: 1617

Answers (2)

Yi Yang
Yi Yang

Reputation: 91

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

Upvotes: 0

S. Spindler
S. Spindler

Reputation: 546

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.

Upvotes: 3

Related Questions