Skip to content

Frontegg prevents tree-shaking — bloating production builds #1266

@AhmadSuddle08

Description

@AhmadSuddle08

Hi Frontegg team,

We’re using @frontegg/react in a production Vite monorepo setup. However, we’ve noticed that even if we only use FronteggProvider, the package pulls in a large set of transitive modules (@frontegg/js, rest-api, redux-store/mocks, etc.), which cannot be treeshaken.

This is likely due to:

  • The use of barrel exports (export * from ...) in src/index.ts

  • Missing sideEffects: false in package.json

  • Lack of per-file ESM exports via "exports" map

Would it be possible to:

Add "sideEffects": false to help treeshakers like Vite/Rollup

Split exports into individual files via "exports" field

Avoid re-exporting mocks and internal tools from the main bundle

This would significantly reduce the production bundle size for teams that only use a subset of components.

Thanks!

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