1. babel-preset-latest
Babel preset including es2015+
babel-preset-latest
Package: babel-preset-latest
Created by: babel
Last modified: Mon, 13 Jun 2022 04:07:17 GMT
Version: 6.24.1
License: MIT
Downloads: 95,503
Repository: https://github.com/babel/babel/tree/master/packages/babel-preset-latest

Install

npm install babel-preset-latest
yarn add babel-preset-latest

babel-preset-latest

Babel preset including es2015, es2016, es2017.

Install

 npm install --save-dev babel-preset-latest

Usage

Via .babelrc (Recommended)

.babelrc

 {
  "presets": ["latest"]
}

Via CLI

 babel script.js --presets latest

Via Node API

 require("babel-core").transform("code", {
  presets: ["latest"]
});

Options

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code