Skip to content

Avoid bundling all of octicons-react #454

@mxstbr

Description

@mxstbr

Looking at @primer/components on bundlephobia, it's massive (40kB min+gzip), mainly because it bundles all of @githubprimer/octicons-react in the StyledOcticon component.

While we are definitely going to use some Octicons, they will only be on specific views and codesplit, bundling all of them into our main bundle is not ideal. Is there a way to lazy load the octicons as they are used or something like that?

EDIT: Found a workaround in #456 by importing specific components. It would still be good to see this solved by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions