当 angular v7 项目同时具有 angular-cli.json 和 angular.json 时会发生什么情况?

What happens when angular v7 project has both angular-cli.json and angular.json?

我正在做 angular v7 项目,有人在解决冲突时犯了错误,提交了 angular-cli.json。现在我在 building/serving 应用程序中没有遇到任何问题。但是,我仍然想知道当 angular v7 项目同时具有 angular-cli.json 和 angular.json 时会发生什么?

Angular 6.0+版本不看angular-cli.json。更多信息请参考this link。希望这有帮助。

TLTR;
如果您正在使用 Angular CLI v6+ 并且由于某种原因文件 .angular-cli.json 出现在您的项目中 - 只需删除它,因为它不再被使用。

解释:

在 Angular CLI (v1-v5) 的早期版本中,他们使用 .angular-cli.json 进行配置。后来 (v6) .angular-cli.json 被称为 Angular Workspace 的不同格式 angular.json 取代。

如果您从早期版本迁移到最新版本,Angular CLI 将为您执行自动迁移,以便将您的 .angular-cli.json 转换为 angular.json

The .angular-cli.json configuration file is replaced with angular.json workspace file, a new file the lays the foundation for multiple projects in a single workspace.

In this file you can find every configuration item and default that Angular CLI uses. Having all configuration on file allows you to avoid typing out multiple configuration flags on each command and npm script. ref: https://github.com/angular/angular-cli/releases?after=v6.1.0-rc.1