[bug] Tree-shaking isn't taking place for unused features
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
2.1.2
wagmi Version
2.11.2
Current Behavior
In cases where AccountModal or ChainModal aren't used, their code is still fully bundled by webpack.
The worst "offender" is the normalize function viem reexports (at 25kb gzipped), which is (probably?) imported RainbowKitProvider -> ModalProvider -> AccountModal -> useProfile -> useMainnetEnsAvatar-> safeNormalize.
Expected Behavior
Rainbowkit should allow for the configuration of used/unused features, and structuring the code in such a way that disabled features are tree-shaked away.
Steps To Reproduce
No response
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
@LufyCZ Thanks for raising this issue. We'll look into how we can tree shake the components when they are not used 👍
@magiziz saw the PR was closed without reason, any updates? Thanks
Any news? I have similar problems when seeing our bundles