【发布时间】:2018-03-20 07:40:26
【问题描述】:
我是 [create-react-app] 的新手,我想了解如何将 ["transform-async-to-generator"] 添加到此构建过程中?在常规情况下,我会将它添加到 .babelrc 中,但看起来不适用于 [create-react-app]。
*通过“看起来不起作用” - 我看到以下错误。
Syntax error: ../web/src/App.js: Unexpected token, expected ( (17:13)
15 | }
16 |
> 17 | test = async () => {
| ^
18 | let x = await this.resolveAfter2Seconds();
19 | try{}
20 | catch(exception){
还有什么方法可以扩展 [create-react-app] 而不修改包本身?
谢谢!
【问题讨论】:
标签: reactjs webpack babeljs create-react-app