@babel/preset-es2017
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-es2017
yarn add --dev @babel/preset-es2017
pnpm add --save-dev @babel/preset-es2017
Usage
With a configuration file (Recommended)
babel.config.json
{
"presets": ["@babel/preset-es2017"]
}
Via CLI
Shell
babel script.js --presets @babel/preset-es2017
Via Node API
JavaScript
require("@babel/core").transformSync("code", {
presets: ["@babel/preset-es2017"]
});