Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce bundle size by replacing ethers with its subpackages #1450

Closed
nedsalk opened this issue Nov 24, 2023 · 1 comment
Closed

Reduce bundle size by replacing ethers with its subpackages #1450

nedsalk opened this issue Nov 24, 2023 · 1 comment
Assignees

Comments

@nedsalk
Copy link
Contributor

nedsalk commented Nov 24, 2023

Apparently our move to ethers v6 caused our minified+gzipped bundle size to increase by ~200kb (size of fuels@0.62.0, size of fuels@0.63.0).
I took a look around and it seems like we can replace our ethers dependencies with just @ethersproject/bytes.

Edit: ethers v6 supports tree-shaking, so such a big jump in package size shouldn't happen.

@nedsalk nedsalk self-assigned this Nov 24, 2023
@nedsalk
Copy link
Contributor Author

nedsalk commented Nov 24, 2023

I built demo-react-vite with the current master and got its size. Afterwards, I removed ethers from all packages and excluded it from the build process in order to not have any build errors, and rebuilt the demo-react-vite app and the size was reduced by only 14 KB, meaning that ethers indeed does get tree-shaken. It seems that bundlephobia.com doesn't catch this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant