This repository was archived by the owner on May 11, 2018. It is now read-only.
v1.0.0
v1.0.0 (2016-12-09)
🚀 New Feature
- Add
useBuiltIns
option (#56) (@hzoo), (@yavorsky), (@existentialism)
A way to apply babel-preset-env
for polyfills (via `"babel-polyfill"``).
This option will apply a new Babel plugin that replaces
require("babel-polyfill")
with the individual requires forbabel-polyfill
based on the target environments.
Install
npm install babel-polyfill --save
In
import "babel-polyfill"; // create an entry js file that contains this
// or
import "core-js";
Out (different based on environment)
// chrome 55
import "core-js/modules/es7.string.pad-start"; // haha left_pad
import "core-js/modules/es7.string.pad-end";
import "core-js/modules/web.timers";
import "core-js/modules/web.immediate";
import "core-js/modules/web.dom.iterable";
.babelrc
Usage
{
"presets": [
["env", {
"targets": {
"electron": 1.4
},
"modules": false, // webpack 2
"useBuiltIns": true // new option
}]
]
}
Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
- Support Electron (#55) (@paulcbetts)
Electron is also an environment, so Paul went ahead and added support for this!
.babelrc
Usage
{
"presets": [ ["env", {"targets": { "electron": 1.4 }}]]
}
Currently we are manually updating the data in /data/electronToChromium.js, but @kevinsawicki says we could generate the data from atom-shell/dist/index.json as well! (Someone should make a PR 😄)