Closed luisherranz closed 4 years ago
I have changed for react-icons-kit
Awesome :)
Let me know once you push the code and I'll take a look.
All is pushed now :-)
Looks great 👍
For context, this was solved in https://github.com/alexadark/frontity-starter-theme/commit/b5c39bb6a3bcfaf26d8f780a641db163a6954180.
The package
react-icons
is adding 624Kb to the whole bundle:As you can see, it is almost as big as the rest of the app, react included.
You can see it yourself by inspecting the
build/analyze/module-production.html
file after runningnpx frontity dev --production
. Don't forget the--production
flag.Normally, you can avoid this problem:
sideEffects: false
in their package jsons: https://webpack.js.org/guides/tree-shaking/https://github.com/frontity/frontity/blob/dev/packages/mars-theme/src/components/loading.js#L3
But in the case of
react-icons
, even though it uses"sideEffects": false,
it is breaking it for the way it imports the ionicons internally. And also, for the weird way it imports those icons, there's no direct pick either, so this library should be avoided at all costs, at least the ionicons part.