Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Import all icons #5815

Answered by hippee-lee
ph55 asked this question in Q&A
Apr 8, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @ph55 - great question and I hope my answer doesn't disappoint you to much. In short, no there isn't a utility to load all icons at once. Here is why:

When clr-icons's were re-written as part of the @cds/core library it was set up the way you show above for performance and optimization benefits. There is no load all icons utility because we have no way of knowing which icons are used or not used in an application. Importing and then adding only the icons that are needed ensures that proper tree shaking can occur during application builds so tooling is able to see which icons are imported. and tree-shake the rest away.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ph55
Comment options

You must be logged in to vote
1 reply
@mathisscott
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants