Skip to content

Commit

Permalink
Turn on Babel helpers (facebook#5093)
Browse files Browse the repository at this point in the history
* Turn on helpers and test importing something with async/await works

* Compiling babel runtime breaks itself

* Add helpers option to babel plugin with defaults

* Make helpers off by default and on in our configuration

* Hit eject and e2e

* meh

* copy'n'paste

* change again

* Turn off helpers by default in /prod, /dev, /test

* oops

* Spread undefined

* Use object assign not object spread

* Put preset in template since it's needed

* Fix e2e tests
  • Loading branch information
Timer authored Sep 25, 2018
1 parent 062be50 commit 1be75bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ module.exports = {
// Unlike the application JS, we only compile the standard ES features.
{
test: /\.js$/,
exclude: /@babel\/runtime/,
use: [
// This loader parallelizes code compilation, it is optional but
// improves compile time on larger projects
Expand All @@ -290,7 +291,10 @@ module.exports = {
babelrc: false,
compact: false,
presets: [
require.resolve('babel-preset-react-app/dependencies'),
[
require.resolve('babel-preset-react-app/dependencies'),
{ helpers: true },
],
],
cacheDirectory: true,
// Don't waste time on Gzipping the cache
Expand Down
6 changes: 5 additions & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ module.exports = {
// Unlike the application JS, we only compile the standard ES features.
{
test: /\.js$/,
exclude: /@babel\/runtime/,
use: [
// This loader parallelizes code compilation, it is optional but
// improves compile time on larger projects
Expand All @@ -324,7 +325,10 @@ module.exports = {
babelrc: false,
compact: false,
presets: [
require.resolve('babel-preset-react-app/dependencies'),
[
require.resolve('babel-preset-react-app/dependencies'),
{ helpers: true },
],
],
cacheDirectory: true,
// Save disk space when time isn't as important
Expand Down

0 comments on commit 1be75bb

Please sign in to comment.