Created by: gaearon
This is a followup to #1177 with a less aggressive fix. For context, read threads #1156 (closed) and #1160 (closed).
Why this works:
- Babel has a bug where object/spread depends on parameters transform: https://github.com/babel/babel/issues/4851. So we have to enable parameters.
- Including regenerator transform in
test
environment was incorrect. Itsasync: false
option only made sense fordevelopment
andproduction
configuration where we usebabel-preset-latest
, and so async functions are already being handled. But fortest
environment we usebabel-preset-env
instead ofbabel-preset-latest
, and so including regenerator second time is redundant (and somehow breaks things—@hzoo could you clarify why this happened?)
I am remove destructuring
and arrow-functions
because they were added as stopgap measure in #1177 but turned out unnecessary per https://github.com/facebookincubator/create-react-app/issues/1156#issuecomment-265160544.
Fixes #1156 (closed) and #1160 (closed).