问题描述
升级到Angular6。现在,我想全局关闭 ng构建
的进度显示。但是,有关 ng config
命令的文档似乎已丢失或用尽,似乎已替换了 ng set / get
命令。 -日期。我想我需要执行以下操作:
Upgraded to Angular 6. Now I want to turn progress display off globally for ng build
. However, the documentation about the ng config
command which apparently replaced ng set/get
seems to be missing or out-of-date. I think I need to do the following:
ng config --global some.path.progress false
但是我不知道 some.path
部分需要什么成为。无论我尝试什么,都会收到无效路径错误。
But I can't figure out what the some.path
part needs to be. Whatever I try I get an "Invalid path" error.
当然,我也可以只编辑〜/ .angular.json
,如果我知道正确的键层次结构。这不起作用:
Of course I could also just edit ~/.angular.json
, if I knew what the right hierarchy of keys was. This doesn't work:
{
"version": 1,
"cli": {
"defaults": {
"build": {
"progress": false
}
}
}
}
在特定的 angular.json
文件中,<$如果将c $ c> progress 选项放在 build
内的 options
键下,则该选项有效。但是,即使 options
中包含了它,在〜/ .angular.json
文件中也似乎忽略了它。 p>
Within a specific angular.json
file, the progress
option works if placed under options
key inside build
. However, it seems to be ignored in the ~/.angular.json
file even if included inside options
.
推荐答案
您不能在全局级别上设置构建进度选项。
You cannot set a build progress option at a global level.
可以在全局级别设置的唯一CLI选项如下。我从代码。
The only CLI options that you can set at a global level are the following. I gleaned this from the code here.
cli.warnings.versionMismatch (boolean)
cli.warnings.typescriptMismatch (boolean)
cli.defaultCollection (string)
cli.packageManager (string)
您可以在项目级别设置此选项(如您在帖子中所述)。这是执行此操作的命令。
You can set this option at the project level (as you said in your post). This is the command you would use to do that.
ng config projects['projectname'].architect.build.options.progress false
或
ng config projects.projectname.architect.build.options.progress false
当然,请将属性设置为 true
以重新打开进度。
Of course, set the property to true
to turn progress back on.
这篇关于为angular-cli v6全局关闭进度显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!