Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es6 build: stricter targets to eliminate async/await transformations #240

Merged
merged 1 commit into from
Sep 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions modules/dev-tools/config/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const TARGETS = {
chrome: '60',
edge: '15',
firefox: '53',
ios: '10.3',
safari: '10.1',
node: '8'
// The goal of the `es6` target is a very clean build (minimally trannsformed) that runs on recent browsers only.
// In particular, it does not transform async/await constructs, which is very helpful when debugging
// Because of this, we only try to support ~1 year old browsers + Node LTS
// Including older versions dramatically increases the number of transforms
const ES6_TARGETS = {
chrome: '64', // Released: 2018-Jan-24, https://en.wikipedia.org/wiki/Google_Chrome_version_history
edge: '18', // Released: 2018-Nov-13, https://en.wikipedia.org/wiki/Microsoft_Edge
firefox: '60', // Released: 2018-May-9, https://en.wikipedia.org/wiki/Firefox_version_history
safari: '12', // Released: 2018-09-07 (OSX Mojave) - https://en.wikipedia.org/wiki/Safari_version_history
ios: '12', // Track Safari
node: '8' // Node 8 is LTS until December 31, 2019.
};

const COMMON_CONFIG = {
Expand Down Expand Up @@ -38,7 +42,10 @@ const ENV_CONFIG = {
presets: [
[ '@babel/env', {
targets: TARGETS,
modules: false
modules: false,
exclude: [
"@babel/plugin-transform-regenerator"
]
}]
],
plugins: [
Expand Down