alexadark / frontity-starter-theme

26 stars 13 forks source link

Get rid of react-icons #1

Closed luisherranz closed 4 years ago

luisherranz commented 4 years ago

The package react-icons is adding 624Kb to the whole bundle:

Screen Shot 2020-03-30 at 08 37 35

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 running npx frontity dev --production. Don't forget the --production flag.

Normally, you can avoid this problem:

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.

alexadark commented 4 years ago

I have changed for react-icons-kit

luisherranz commented 4 years ago

Awesome :)

Let me know once you push the code and I'll take a look.

alexadark commented 4 years ago

All is pushed now :-)

luisherranz commented 4 years ago

Looks great 👍

luisherranz commented 4 years ago

For context, this was solved in https://github.com/alexadark/frontity-starter-theme/commit/b5c39bb6a3bcfaf26d8f780a641db163a6954180.