carbon-icons-angular
carbon-icons-angular copied to clipboard
Filesize of compiled angular app (vendor.js)
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].
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