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!
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!