💻
How are you using Babel?
babel-loader (webpack)
Input code
console.log('hello world!');
Configuration file name
.babelrc.json
Configuration
{
"presets": [
[
"@babel/preset-env",
{
"bugfixes": true,
"targets": {
"browsers": "Edge >= 108, Firefox >= 108, FirefoxAndroid >= 107, Chrome >= 108, ChromeAndroid >= 108, Safari >= 16.1, iOS >= 16.1, not dead",
"esmodules": true
},
"useBuiltIns": "usage",
"corejs": "3.27.2"
}
]
]
}
Current and expected behavior
Documentation for options "targets" says:
Please note: when specifying both browsers and the esmodules target, they will be intersected.
However, when building the following message is displayed.
@babel/preset-env: esmodules and browsers targets have been specified together.
browsers target, Edge >= 108, Firefox >= 108, FirefoxAndroid >= 107, Chrome >= 108, ChromeAndroid >= 108, Safari >= 16.1, iOS >= 16.1, not dead will be ignored.
Which is correct ? Is it intersected or ignored ?
Environment
Babel Versions:
- "@babel/core": "^7.20.12",
- "@babel/preset-env": "^7.20.2",
- "babel-loader": "^9.1.2",
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.
💻
How are you using Babel?
babel-loader (webpack)
Input code
Configuration file name
.babelrc.json
Configuration
{ "presets": [ [ "@babel/preset-env", { "bugfixes": true, "targets": { "browsers": "Edge >= 108, Firefox >= 108, FirefoxAndroid >= 107, Chrome >= 108, ChromeAndroid >= 108, Safari >= 16.1, iOS >= 16.1, not dead", "esmodules": true }, "useBuiltIns": "usage", "corejs": "3.27.2" } ] ] }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-envAdditional context
I would like rely on the intersection behaviour in the future, if possible.