详细报错如下:
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
看起来 CRA5 会将警告视作报错,也就是更严格的构建要求,解决办法有俩
- 逐个清理项目构建过程中的警告 ~
- 构建时修改环境变量 CI
第一种不用赘述,第二种也很简单,在构建命令前设置 CI 为空就行
"scripts": {
"build": "CI='' yarn build"
}