preset-latest is deprecated
{ "presets": ["latest"] } === { "presets": ["env"] }
Use preset-env instead.
This is a special preset that will contain all yearly presets so user’s won’t need to specify each one individually.
It currently includes:
npm install --save-dev babel-preset-latest
.babelrc
(Recommended).babelrc
{
"presets": ["latest"]
}
babel script.js --presets latest
require("babel-core").transform("code", {
presets: ["latest"]
});
es2015
boolean
, defaults to true
.
Toggles including plugins from the es2015 preset.
{
"presets": [
["latest", {
"es2015": false
}]
]
}
You can also pass options down to the es2015
preset.
{
"presets": [
["latest", {
"es2015": {
"modules": false
}
}]
]
}
Note: This also works for the other preset-year options below.
es2016
boolean
, defaults to true
.
Toggles including plugins from the es2016 preset.
es2017
boolean
, defaults to true
.
Toggles including plugins from the es2017 preset.