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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: @babel/plugin-transform-runtime not transform Object.hasOwn correctly #15572
Comments
Hey @AXiLiYa! 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. |
Unfortunately there is no good way yet to specify an higher version. You could update your config to this: {
"plugins": [
"@babel/plugin-transform-runtime",
["babel-plugin-polyfill-corejs3", { "method": "usage-pure", "version": "3.30" }]
]
} and add However, with that config Babel would inject imports to Once we have #15531 or something similar, the above config should properly injects imports to |
Thanks a lot for your answer. But I still have a question. I find you said
Is this means the entry I input will polyfilled correctly, but code in |
Yes exactly. Most of them are ES5-compatible, but some of them use |
馃捇
How are you using Babel?
@babel/cli
Input code
Configuration file name
babel.config.json
Configuration
Current and expected behavior
I used @babel/cli directly with the command
./node_modules/.bin/babel index.js --out-dir lib
. This is the output:The
Promise
andArray.includes
are replace with@babel/runtime-corejs3
correctly. ButObject.hasOwn
not. And I find the@babel/runtime-corejs3/core-js-stable
didn't exist the polyfill ofObject.hasOwn
which is realized in corejs. I have read the doc about@babel/plugin-transform-runtime
, but I haven't found anything about this. So this behavior is designed so? Or I have missed some informations?Environment
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: