12.0.0-3 • Published 7 years ago
@gerhobbelt/babel-preset-modern-browsers v12.0.0-3
This preset covers es2015, es2016, es2017 and es2018.
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
- @babel/preset-env, especially
targets.esmodules
Modern browsers
- with
edge: true: - with
edge: false:
Installation
npm install --save-dev babel-preset-modern-browsers@next @babel/coreUsage
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.
Release Dates
Firefox
| Date | Version | ESR |
|---|---|---|
| 2018-12-11 | ||
| 2018-10-23 | ||
| 2018-09-05 | ||
| 2018-06-26 | ||
| 2018-05-09 | ESR | |
| 2018-03-13 | ||
| 2018-01-16 |
Chrome (Desktop release date) (Version History)
| Date | Version |
|---|---|
| 2018-10-16 | |
| 2018-09-04 | |
| 2018-07-24 | |
| 2018-05-29 | |
| 2018-04-17 | |
| 2018-03-06 | |
| 2018-01-23 |
Safari (Version History)
| Date | Version |
|---|---|
| 2018-03-29 | |
| 2017-09-19 | |
| 2017-03-27 | |
| 2016-09-20 |
Edge (Version History)
| Date | Version |
|---|---|
| 2018-04-30 | |
| 2017-09-26 | |
| 2017-03-20 |
Thanks
- Inspired by https://github.com/askmatey/babel-preset-modern