我有一个名为Frontend-Core-Components的项目,其中包含我的应用程序组件。
我还有另一个项目(暂时就叫它Alpha ),它包含AlphaApiService,我通过它的属性传递给应用程序组件,我在Alpha的index.tsx中完成这项工作
Alpha使用Create-react-app,我正在使用rescript修改Webpack的配置,以添加前端核心组件作为一个模块,在此resolve.alias配置中,我使用resolve.alias将导入从Alpha index.tsx映射到Frontend-Core-Components。
这一切似乎都很好用,除了当我从Alpha项目运行build时,我遇到了以下问题。
SyntaxError: /Users/coolguy/project/alpha/src/index.tsx: Unexpected token (9:11)
7 |
8 | window.onload = () => {
> 9 | render(<App apiService={new AlphaApiService()} />,
document.getElementById('root'))
| ^
10 | }
11 |有什么想法吗?
发布于 2020-05-06 15:14:57
或者,您可以在您的ts-loader(或babel-loader)规则中include该Frontend-Core-Components。
发布于 2020-04-30 06:31:05
https://stackoverflow.com/questions/61454128
复制相似问题