Improve Tree Shakability / Reduce Size of Library #1371
Replies: 1 comment
-
CORRECTION: For posterity this is only a problem when using dynamic imports. Static imports should tree-shake just fine. See #3565 (comment) I want to second this. I am manually bundling my dependencies with vite, and believe there is scope for huge savings by exporting each connector individually. If I import a single connector like this:
My bundle size increases by 2.8 MB:
In contrast, if I copy paste the
Here are more details: Due to the structure of the package exports, is not possible to import connectors individually, I get the following Typescript error:
If you'd like me to share my repo I'd be happy to. |
Beta Was this translation helpful? Give feedback.
-
First impressions are really good of the library. Core seems easier to integrate into an existing app.
At first glance, the import cost of createClient and MetaMaskConnector seem quite large. (I haven't looked at the source though; just going by the VSCode plugin)
Keeping the bundle size of my app down is pretty important.
Any work planned on shrinking parts of the library or improving Tree Shaking (if possible?)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions