Skip to content

Commit

Permalink
Set the babel target to the same minimum Node.js version via `browser…
Browse files Browse the repository at this point in the history
…slist`.

By default, if no `targets` option is passed, or `browserslist` isn't set in
the `package.json`, `@babel/preset-env` only transpiles to ES2015/ES6.

Since we're only testing Node.js 10+ and we've set the `engines` property to
indicate our intention of only supporting Node.js 10+, I think we can
transpile to a newer target safely.  Not truly important to count bytes in
this package, but this shaves off an unimpressive 8kB (but also a 20%
reduction for this package).
  • Loading branch information
abernix committed May 29, 2020
1 parent f87519f commit 3ecf7de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"engines": {
"node": ">=10.0"
},
"browserslist": "node 10",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.10.0",
Expand Down

0 comments on commit 3ecf7de

Please sign in to comment.