Babel presets for modern browsers
JavaScript
Clone or download

README.md

babel-preset-modern-browsers

Babel presets for modern browsers

This preset covers es2015, es2016, es2017 and es2018.

More info in the compatibility table below

Alternatives

Modern browsers

  • with edge: true: Edge 15 Firefox 53 Chrome 55 Opera 42 Safari 10.1
  • with edge: false: Firefox 57 Chrome 63 Opera 50 Safari 10.1

Installation

npm install --save-dev babel-preset-modern-browsers@next @babel/core

Usage

Add the following line to your .babelrc file:

{
  "presets": ["modern-browsers"]
}

Options

  • loose: Enable “loose” transformations for any plugins in this preset that allow them (Disabled by default).
  • modules - Enable transformation of ES6 module syntax to another module type (Enabled by default to "commonjs"). Can be false to not transform modules, or "commonjs"
  • es2018 - Enable es2018 features (Enabled by default)
  • shippedProposals - Enable features in stages but already available in browsers (Enabled by default)
  • edge - Support Edge (Enabled by default)
{
  presets: [
    ["modern-browsers", { "loose": true }]
  ]
}
{
  presets: [
    [require("babel-preset-modern-browsers"), { "loose": true }]
  ]
}

Edge

Missing features added for edge option:

  • function-name
  • object rest/spread properties

Compatibility Table

Note: most unused plugins are babel 6 plugins, I didn't update them for the documentation.

Feature Edge Firefox Chrome Opera Safari

Shipped Proposals

Optional catch binding Edge None Firefox 58 Chrome 66 Opera 53 Safari 11.1
↳ (used) syntax-optional-catch-binding

ES2018

Object Rest/Spread Properties Edge None Firefox 55 Chrome 60 Opera 47 Safari 11.1
edge: proposal-object-rest-spread
else syntax-object-rest-spread
RegExp Unicode Property Escapes Edge None Firefox None Chrome 64 Opera 51 Safari 11.1
↳ (used) proposal-unicode-property-regex
Asynchronous Iterators Edge None Firefox 57 Chrome 63 Opera 50 Safari 11.1
edge: plugin-proposal-async-generator-functions
else syntax-async-generators

ES2017

trailing commas in function Edge 14 Firefox 52 Chrome 58 Opera 45 Safari 10
↳ (used) syntax-trailing-function-commas
async function Edge 15 Firefox 52 Chrome 55 Opera 42 Safari 10.1
↳ (unused) transform-async-to-generator

ES2016

exponentiation operator Edge 14 Firefox 52 Chrome 52 Opera 39 Safari 10
↳ (unused) transform-exponentiation-operator

ES2015

Edge Partial Firefox 53 Chrome 52 Opera 39 Safari 10

Syntax

default parameters Edge 14 Firefox 53 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-parameters
rest parameters Edge 12 Firefox 43 Chrome 47 Opera 34 Safari 10
↳ (unused) transform-es2015-parameters
spread Edge 13 Firefox 36 Chrome 46 Opera 33 Safari 10
↳ (unused) transform-es2015-spread
computed properties Edge 12 Firefox 34 Chrome 44 Opera 31 Safari 7.1
↳ (unused) transform-es2015-computed-properties
shorthand properties Edge 12 Firefox 33 Chrome 43 Opera 30 Safari 9
↳ (unused) transform-es2015-shorthand-properties
for...of Edge 14 Firefox 53 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-es2015-for-of
template string Edge 13 Firefox 34 Chrome 41 Opera 28 Safari 9
↳ (unused) transform-es2015-template-literals
Regexp sticky Edge 13 Firefox 31 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-sticky-regex
Regexp unicode Edge 12 Firefox 46 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-es2015-unicode-regex
destructuring Edge 15 Firefox 53 Chrome 52 Opera 39 Safari 10
↳ (unused) transform-es2015-destructuring
Unicode Strings Edge 12 Firefox 45 Chrome 44 Opera 31 Safari 9
Octal/Binary Numbers Edge 12 Firefox 36 Chrome 41 Opera 28 Safari 9
↳ (unused) transform-es2015-literals

Bindings

const Edge 14 Firefox 51 Chrome 49 Opera 36 Safari 10
let Edge 14 Firefox 51 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-block-scoping
block-level function declaration Edge 11 Firefox 46 Chrome 41 Opera 28 Safari 10
↳ (unused) transform-es2015-block-scoped-functions

Functions

arrow functions Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (used with edge, with function-name) transform-es2015-arrow-functions
classes Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-classes
super Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-object-super
generators Edge 13 Firefox 53 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-regenerator

Built-ins

typeof Symbol Edge 12 Firefox 36 Chrome 38 Opera 25 Safari 9
↳ (unused) transform-es2015-typeof-symbol

Built-in extensions

function name Edge Partial Firefox 53 Chrome 52 Opera 39 Safari 10
↳ (used with edge) transform-es2015-function-name

Release Dates

Firefox

Date Version ESR
2018-12-11 Firefox 64
2018-10-23 Firefox 63
2018-09-05 Firefox 62
2018-06-26 Firefox 61
2018-05-09 Firefox 60 ESR
2018-03-13 Firefox 59
2018-01-16 Firefox 58

Chrome (Desktop release date) (Version History)

Date Version
2018-10-16 Chrome 70
2018-09-04 Chrome 69
2018-07-24 Chrome 68
2018-05-29 Chrome 67
2018-04-17 Chrome 66
2018-03-06 Chrome 65
2018-01-23 Chrome 64

Safari (Version History)

Date Version
2018-03-29 Safari 11.1
2017-09-19 Safari 11.0
2017-03-27 Safari 10.1
2016-09-20 Safari 10.0

Edge (Version History)

Date Version
2018-04-30 Edge 17
2017-09-26 Edge 16
2017-03-20 Edge 15

Thanks