我正在尝试将 React 应用程序移动到 Create-React-App 中,但正在努力使某些事情发挥作用,并且并不真正了解 Create-React-App 允许和不允许的内容(关于自定义和添加额外module)。
目前,来自 React 应用程序的 CRA 无法在以下位置编译:
export App from "./App/App"
有错误:
./src/containers/index.js
SyntaxError: /Volumes/Mexico/Workspace/create-react-app-test/myapp/src/containers/index.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (1:8):
Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.
我不想从 CRA 退出,我不相信我可以更改 Babel 配置,所以我不知道该怎么做。
CRA 支持这种语法吗?如果是这样,我应该怎么做才能让它工作。如果没有,我是否必须重写所有代码?
react脚本 2.1.8 节点 v11.14.0 npm 6.9.0
谢谢,阿什利。