carbon-icons-angular icon indicating copy to clipboard operation
carbon-icons-angular copied to clipboard

Filesize of compiled angular app (vendor.js)

Open simplicitytrade opened this issue 3 years ago • 1 comments

I added this package to my package.json as mentioned in the readme file.

In app.module.ts import { AddModule } from '@carbon/icons-angular';

imports: [ [...], AddModule, ],

To be sure the icon is really used and compiled, I added the icon in my app.component.html

<svg ibmIconAdd size="32"></svg>

(For testing this behaviour I removed all other carbon-angular modules.)

After compiling the app the "vendor.js" file is about 46mb(!) large. Generating a production build using npm run build leads to the same result of having really large output files.

Dependencies:

"@angular/core": "~11.2.6", // latest-angular version [...] "@carbon/icons-angular": "^11.2.1", "carbon-components": "^10.30.0", "carbon-components-angular": "^4.44.0",


Sorry for not presenting a stackblitz demo. Somehow I cant import this package there; it results in getting this error:

Error in ~/src/main.ts ngcc failed to run on @carbon/[email protected].

simplicitytrade avatar Mar 19 '21 10:03 simplicitytrade

I do not have such a problem. I just want to mention that in order to build a prod version it is necessary to run npm run build -- --prod or ng build --prod

grenobnik avatar Apr 07 '21 12:04 grenobnik