-
Notifications
You must be signed in to change notification settings - Fork 391
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
ESM output contains many duplicated helpers #2230
Comments
@rschristian thanks for reporting this. We just released a fix, let me know if it looks good on your end now. |
Marginally improved, but still a very large amount of duplication. Looking at the bundle, there's now only 2 copies of the iterator helper ( Modern compression being a marvel means this isn't too egregious over the web but it does still have a large & needless impact on parse times. I wouldn't be surprised if 20%+ of the minified bundle is just duplicated helpers. |
Ah, I was just looking at helpers that were duplicated in the bundling of |
Description
As
@docsearch/react
compiles each of its files in isolation for the ESM output, the module as a whole ends up with a dozen duplicated helpers even in the most simple demonstration.Edit: This applies for all dependencies of
@docsearch/react
too.This heavily bloats the bundles of applications which use it, and bloats them needlessly.
Steps to reproduce
src/main.jsx
:npm run build
"Invalid attempt to destructure non-iterable instance...."
)Expected behavior
That there aren't heavily duplicated helpers throughout the bundles.
This likely means moving to better build tooling, as compiling each module in isolation isn't really viable, nor has it ever been. The asset quality takes a pretty big hit when doing so.
Environment
The text was updated successfully, but these errors were encountered: