具有多个目标的 Architect 命令不能指定覆盖

Architect commands with multiple targets cannot specify overrides

我正在转换库(ng-app-state) to use the angular cli, now that v6 supports libraries(耶!)。

当尝试 运行 某些 CLI 命令时失败并出现如下错误:

$ ng test --source-map ng-app-state
Architect commands with multiple targets cannot specify overrides.'test' would be run on the following projects: ng-app-state-monorepo,ng-app-state
Error: Architect commands with multiple targets cannot specify overrides.'test' would be run on the following projects: ng-app-state-monorepo,ng-app-state
    at TestCommand.validate (S:\Programming\git repositories\ng-app-state-monorepo\node_modules\@angular\cli\models\architect-command.js:91:23)

你需要先写库名,再写选项。例如

# do this
$ ng test ng-app-state --watch=true --source-map

# don't do this
$ ng test --watch=true --source-map ng-app-state

如果您有多个应用程序,您可以在下面的命令中提及其名称。

yarn test web --code-coverage

此处 web 是 angular 项目中的应用程序。