Skip to content

Bloated browser bundle because of barrel file #62

Description

@FabianKoder

Hi, thanks for this great library. After analysing our bundle we found that including reading-time via ESM imports as recommended causes several node dependencies (namely stream) to be included when building our Next.js app. My best guess would be that this is because the main barrel file imports the stream version as well and that import breaks treeshaking. This could be fixed multiple ways, probably the most low effort way would be creating two additional different barrel files (e.g. reading-time/browser and reading-time/node) that only export the necessary stuff.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions