15.0.2 • Published 4 years ago

babel-preset-modern-browsers v15.0.2

Weekly downloads
1,113
License
ISC
Repository
github
Last release
4 years ago

This preset covers syntax of es2015, es2016, es2017, es2018, es2019 and es2020.

More info in the compatibility table below

babel 7

Since v12, this package requires @babel/core@7.0.0. If you use babel 6, you can still use the version "11.0.1" of this package. If you want to migrate, you can read the announcement and the official migration guide.

Alternatives

If you don't need preset-env, using this package will only install a few dependencies.

Modern browsers

Edge 83 Firefox 78 Chrome 80 Opera 67 Safari 13.1

Installation

npm install --save-dev babel-preset-modern-browsers @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"
  • shippedProposals - Enable features in stages but already available in browsers (Enabled by default)
{
  presets: [['modern-browsers', { loose: true }]];
}
{
  presets: [[require('babel-preset-modern-browsers'), { loose: true }]];
}

Browserlist

Edge >= 83, Firefox >= 78, FirefoxAndroid  >= 78, Chrome >= 80, ChromeAndroid >= 80, Opera >= 67, OperaMobile >= 67, Safari >= 13.1, iOS >= 13.4

Compatibility Table

FeatureEdgeFirefoxChromeOperaSafari
Shipped Proposals
Numeric SeparatorsEdge 79Firefox 70Chrome 75Opera 62Safari 13
syntax-numeric-separator
ES2020
Optional chaining (?.)Edge 80Firefox 74Chrome 80Opera 67Safari 13.1
Nullish Coalescing operator (??)Edge 80Firefox 72Chrome 80Opera 67Safari 13.1
ES2019
Optional catch bindingEdge 79Firefox 58Chrome 66Opera 53Safari 11.1
JSON stringsEdge 79Firefox 62Chrome 66Opera 53Safari 12
ES2018
Object Rest/Spread PropertiesEdge 79Firefox 55Chrome 60Opera 47Safari 11.1
RegExp Unicode Property EscapesEdge 79Firefox 78Chrome 64Opera 51Safari 11.1
Asynchronous IteratorsEdge 79Firefox 57Chrome 63Opera 50Safari 12
ES2017
trailing commas in functionEdge 14Firefox 52Chrome 58Opera 45Safari 10
async functionEdge 15Firefox 52Chrome 55Opera 42Safari 10.1
ES2016
exponentiation operatorEdge 14Firefox 52Chrome 52Opera 39Safari 10
ES2015Edge 79Firefox 53Chrome 52Opera 39Safari 10
Syntax
default parametersEdge 14Firefox 53Chrome 49Opera 36Safari 10
rest parametersEdge 12Firefox 43Chrome 47Opera 34Safari 10
spreadEdge 13Firefox 36Chrome 46Opera 33Safari 10
computed propertiesEdge 12Firefox 34Chrome 44Opera 31Safari 7.1
shorthand propertiesEdge 12Firefox 33Chrome 43Opera 30Safari 9
for...ofEdge 14Firefox 53Chrome 51Opera 38Safari 10
template stringEdge 13Firefox 34Chrome 41Opera 28Safari 9
Regexp stickyEdge 13Firefox 31Chrome 49Opera 36Safari 10
Regexp unicodeEdge 12Firefox 46Chrome 51Opera 38Safari 10
destructuringEdge 15Firefox 53Chrome 52Opera 39Safari 10
Unicode StringsEdge 12Firefox 45Chrome 44Opera 31Safari 9
Octal/Binary NumbersEdge 12Firefox 36Chrome 41Opera 28Safari 9
Bindings
constEdge 14Firefox 51Chrome 49Opera 36Safari 10
letEdge 14Firefox 51Chrome 49Opera 36Safari 10
block-level function declarationEdge 11Firefox 46Chrome 41Opera 28Safari 10
Functions
arrow functionsEdge 13Firefox 45Chrome 49Opera 36Safari 10
classesEdge 13Firefox 45Chrome 49Opera 36Safari 10
superEdge 13Firefox 45Chrome 49Opera 36Safari 10
generatorsEdge 13Firefox 53Chrome 51Opera 38Safari 10
Built-ins
typeof SymbolEdge 12Firefox 36Chrome 38Opera 25Safari 9
Built-in extensions
function nameEdge 79Firefox 53Chrome 52Opera 39Safari 10

Partially Shipped Proposals (Not included)

FeatureEdgeFirefoxChromeOperaSafari
Static & Instance Class FieldsEdge 79Firefox NoneChrome 74Opera 61Safari None
proposal-class-properties
Private Class MethodsEdge 84Firefox NoneChrome 84Opera 71Safari None
proposal-private-methods

Release Dates

Thanks

15.0.2

4 years ago

15.0.0

4 years ago

15.0.1

4 years ago

14.2.0

5 years ago

14.2.1

5 years ago

14.1.1

5 years ago

14.1.0

5 years ago

14.0.0

6 years ago

13.1.0

6 years ago

13.0.1

6 years ago

13.0.0

6 years ago

12.0.0

6 years ago

12.0.0-beta.1

7 years ago

12.0.0-beta.0

7 years ago

11.0.1

7 years ago

11.0.0

7 years ago

10.0.1

7 years ago

10.0.0

7 years ago

9.0.2

8 years ago

9.0.1

8 years ago

9.0.0

8 years ago

8.1.2

8 years ago

8.1.1

8 years ago

8.1.0

8 years ago

8.0.0

8 years ago

7.0.0

8 years ago

6.0.0

8 years ago

5.1.0

8 years ago

5.0.2

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.0.0

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago