@babel/preset-es2016
danger
As of Babel v6, all the yearly presets have been deprecated.
We recommend using @babel/preset-env
instead.
Install
- npm
- Yarn
- pnpm
npm install --save-dev @babel/preset-es2016
yarn add --dev @babel/preset-es2016
pnpm add --save-dev @babel/preset-es2016
Usage
With a configuration file (Recommended)
babel.config.json
{
"presets": ["@babel/preset-es2016"]
}
Via CLI
Shell
babel script.js --presets @babel/preset-es2016
Via Node API
JavaScript
require("@babel/core").transformSync("code", {
presets: ["@babel/preset-es2016"]
});