Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure default icons are being tree-shaken, otherwise remove them #134

Open
mattfwood opened this issue Oct 1, 2020 · 3 comments
Open

Comments

@mattfwood
Copy link
Contributor

mattfwood commented Oct 1, 2020

Describe the bug
Right now, even if you use none of the default icons, they're included in your final bundle, adding a lot of bundle size.

To Reproduce
Steps to reproduce the behavior:

  1. Create any react app using Minerva UI
  2. Inspect final bundle
  3. See icons included in final result, even if unused

Expected behavior
Unused icons should not increase final bundle size

Screenshots
image

@mattfwood
Copy link
Contributor Author

F5FF03E5-E767-445B-A493-0E8A332ACB66

For additional context, when analyzing minerva-ui using bundlephobia, almost 60% of the bundle size is from the icons.

We should probably rethink this or make it a separate package to avoid it being included unnecessarily

@mattfwood
Copy link
Contributor Author

mattfwood commented Oct 1, 2020

Also, some components (like modals and and menus) use the icons. We might need to hard-code those to be included

@mattfwood
Copy link
Contributor Author

Update: I don't think I know how tree shaking works with TSDX. Maybe we should remove react-feather altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant