-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Should we combine the transform-runtime and preset-env in an application? #11515
Comments
Hey @NE-SmallTown! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
The docs are confusing: Also, we are currently reworking our methods to inject polyfill to unify them: #10008
This should be asked in the |
Answer to the first question: To reduce the helper duplication you should use the |
Thanks, it's more clear now! The second question has beeen refered to zloirock/core-js#833 |
Question 1
I find that there are many unnecessary duplications in the (webpack) bundle (output)result, to be specific, they all are the helpers(like
classCheck
,objectSpread
(due to theobject-spread
plugin).So, I want to reduce the duplications. If it's a library, sure, I will use transform-runtime plugin(refer to
runtime-corejs3
) to do this. But now this is an application, so, what's the correct way to do this?Therefor I'm getting confused because the
transfrom-runtime
plugin is recommended for library(and is for the whole reduction. i.e.core-js
,regenerator
and the helpers). But here I just want to reduce the helper duplications, not others duplications because that has been done bypreset/env
.So here the question I want to ask/discuss is that is it necessary to reduce the
helpers
duplications in an application, if yes, and how?Question 2
The other question is,
core-js/modules/es.promise.js
andcore-js-pure/modules/es.promise.js
are exactly the same code, the main difference just is that the former has global pollution? If so, whycore-js
doesn't use(directly import)core-js-pure
to polyfill and then add it to global? IMO, this will greatly reduce the duplications because at now the libs usetransform-runtime
(finallycore-js-pure
) but apps usepreset-env
(finallycore-js
), there is no shared/shareable codes between apps and libs, right?The text was updated successfully, but these errors were encountered: