Is there a practical way to optimize this so that only used icons end up in the bundle?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"All Taiga UI icons are name @tui.
and then the name of the file, you would need a script to go through your source code and collect all used icon names in an array and then copy only those files then. At the moment there's no tool to do this out of the box.
-
My bundle size is quite large (16mb) because all Taiga UI icons are copied to the dist folder, not just the ones I need. {
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
} Is there a practical way to optimize this so that only used icons end up in the bundle? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
They are not in the bundle, they just lay in the assets folder. Are you limited on hosting space? Your users would only download the icons used. |
Beta Was this translation helpful? Give feedback.
All Taiga UI icons are name
@tui.
and then the name of the file, you would need a script to go through your source code and collect all used icon names in an array and then copy only those files then. At the moment there's no tool to do this out of the box.