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

Only import icons that are used #108

Closed
rileyhilliard opened this issue Feb 21, 2019 · 1 comment
Closed

Only import icons that are used #108

rileyhilliard opened this issue Feb 21, 2019 · 1 comment

Comments

@rileyhilliard
Copy link
Contributor

rileyhilliard commented Feb 21, 2019

Describe the bug
This is part II of issue #106
react-digraph is importing all of react-icons, but it is only using one icon from font awesome.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout (or merge) Adding webpack-build-analyzer to react-digraph #107
  2. yarn && yarn analyze-bundle
  3. look at the dependency output

Expected behavior
react-digraph should only need to output the one icon that is being used in the final production build. Optimizing this is fairly straight forward, and will reduce the prod build of react-digraph by about 60%.

Screenshots
screen shot 2019-02-21 at 5 00 03 am

Desktop (please complete the following information):

  • OS: N/A
  • Browser N/A
  • Version N/A

Additional context
I plan on fixing this myself. This issue is only for tracking purposes.

@rileyhilliard
Copy link
Contributor Author

screen shot 2019-02-24 at 8 35 41 am

screen shot 2019-02-24 at 8 29 26 am

@ajbogh / @chiwoojo
I was able to optimize the production build footprint by 68% by only importing the expand icon that is being used by react-digraph. This reduces the GZipped size from 548kb to 174kb.
Once #107 is merged, I'll submit the pull request for the optimization above.

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