-
-
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
[Bug]: babel/preset-env - document says esmodules is intersected, build warning says its ignored. #15371
Comments
Hey @epreston! 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. |
Thank you babel-bot. We need to update the documentation or tool. |
It should definitely be intersected, I'll check what the code does. |
If you specify your targets at the top level of your config (so in the generic Babel options — https://babeljs.io/docs/en/options#targetsesmodules), {
"targets": {
"browsers": "Edge >= 108, Firefox >= 108, FirefoxAndroid >= 107, Chrome >= 108, ChromeAndroid >= 108, Safari >= 16.1, iOS >= 16.1, not dead",
"esmodules": true
},
"presets": [
[
"@babel/preset-env",
{
"bugfixes": true,
"useBuiltIns": "usage",
"corejs": "3.27.2"
}
]
]
} However, for backward compatibility we couldn't change the pre-existing behavior of I recommend using the top-level
|
We can also modify the message in code to link to the documentation. |
I see, that makes sense. You are right, using the top-level targets option is the best way to go. Should I leave this open to capture the "documentation" task ? |
Use top level targets per: babel/babel#15371 (comment)
Yes please! (or, if you want to open a PR to github.com/babel/website, that would be even better 👀) |
Good idea, I will try my hand at updating the documentation. I'll reference the info you provided here and close issue once the PR is submitted. |
PR Submitted. Thank you for clarifying this for me. |
I did that, waited a month. What's the process ? |
Sorry, the only problem was that I somehow forgot about your PR 😅 |
Maybe it's for the best. @JLHwung was able to help us refine it with the extra time. |
💻
How are you using Babel?
babel-loader (webpack)
Input code
Configuration file name
.babelrc.json
Configuration
Current and expected behavior
Documentation for options "targets" says:
However, when building the following message is displayed.
Which is correct ? Is it intersected or ignored ?
Environment
Babel Versions:
Node Versions:
OS:
Possible solution
Depending on which is correct, update documentation or warning message in
babel/preset-env
Additional context
I would like rely on the intersection behaviour in the future, if possible.
The text was updated successfully, but these errors were encountered: