Skip to content

Commit 1be75bb

Browse files
authored
Turn on Babel helpers (facebook#5093)
* 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
1 parent 062be50 commit 1be75bb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

config/webpack.config.dev.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ module.exports = {
275275
// Unlike the application JS, we only compile the standard ES features.
276276
{
277277
test: /\.js$/,
278+
exclude: /@babel\/runtime/,
278279
use: [
279280
// This loader parallelizes code compilation, it is optional but
280281
// improves compile time on larger projects
@@ -290,7 +291,10 @@ module.exports = {
290291
babelrc: false,
291292
compact: false,
292293
presets: [
293-
require.resolve('babel-preset-react-app/dependencies'),
294+
[
295+
require.resolve('babel-preset-react-app/dependencies'),
296+
{ helpers: true },
297+
],
294298
],
295299
cacheDirectory: true,
296300
// Don't waste time on Gzipping the cache

config/webpack.config.prod.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ module.exports = {
314314
// Unlike the application JS, we only compile the standard ES features.
315315
{
316316
test: /\.js$/,
317+
exclude: /@babel\/runtime/,
317318
use: [
318319
// This loader parallelizes code compilation, it is optional but
319320
// improves compile time on larger projects
@@ -324,7 +325,10 @@ module.exports = {
324325
babelrc: false,
325326
compact: false,
326327
presets: [
327-
require.resolve('babel-preset-react-app/dependencies'),
328+
[
329+
require.resolve('babel-preset-react-app/dependencies'),
330+
{ helpers: true },
331+
],
328332
],
329333
cacheDirectory: true,
330334
// Save disk space when time isn't as important

0 commit comments

Comments
 (0)