primer / octicons

A scalable set of icons handcrafted with <3 by GitHub
https://primer.style/foundations/icons
MIT License
8.22k stars 829 forks source link

fix(octicons-styled): update how package is output to reduce bundle size #1027

Open joshblack opened 3 weeks ago

joshblack commented 3 weeks ago

Closes https://github.com/primer/octicons/issues/981

Update how @primer/octicons-styled is built so that it doesn't re-include icons in each entrypoint 😅

This seems to occur because rollup (at least in the previous version used) does not eliminate unused exports for each of the entry points that were being generated for icons. This PR updates our dependencies on rollup to the latest version and changes how these icons are emitted so that there is only ever one instance of the icons from octicons-react in the bundle.

This also points out that this package could also be importing directly from @primer/octicons-react but I'll save that for another change if we want to go down that route.

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: a7c3d36bf631ee9c7d617bc05b2f465ff8c24ce8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------- | ----- | | @primer/octicons | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR