-
-
Notifications
You must be signed in to change notification settings - Fork 533
[FEAT REQ] Keep dependencies external in build results #974
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
Comments
This is definitely something we weren't considering. We'll see how to approach this since we've recently migrated to esbuild as the default bundler. Thanks for the suggestion. |
Thank you :) a quick lookaround & inspection of the dist esm build reveals that dependencies weight about half the size of the minified file. I know it isn't much, since the minified is pretty light, but duplicate transitive dependencies add up quite quickly Cheers ! 🍻 |
50% is actually quite a lot IMO, it would only start being less relevant if we were talking about <<<1KB. I'm not super experienced with optimal practices when it comes to bundling, so I'm not sure how best to approach this. @danielbarion will probably have some more interesting perspectives. If you also have any further suggestions regarding this, we'd be glad to hear. |
I'll do some tests as soon as I have free time, maybe if we add the float-ui as
Thanks for letting us know about this problem! Also, as @gabrieljablonski said, every 1kb is important for us. |
Having contributed to multiple front-end libs myself, I took the habit to keep almost every deps of those libs as peer dependencies (except very small ones) and configure the bundler to preserve import/require statements, EXCEPT for builds that aims to be distributed via CDN. I never used esbuild though, but if you're OK with it, I can do the tests, PR with config & a couple of stats. I love bundlers, and I would be pleased to give you a hand |
Yes sure! Please feel free to submit a PR and we will take a look and test as soon as possible :) |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Building an app that imports @floating-ui results in the transitive dependency being included twice. Moreover, stats in bundlephobia does not reflect the size of this module itself, but concatenated with all its deps.
Describe the solution you'd like
Mark dependencies as external in rollup config, so that the app bundling handles resolution itself
Describe alternatives you've considered
Use the source directly
The text was updated successfully, but these errors were encountered: