问题
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
But I can't figure out what the some.path
part needs to be. Whatever I try I get an "Invalid path" error.
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
}
}
}
}
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
.
回答1:
You cannot set a build progress option at a global level.
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
Or
ng config projects.projectname.architect.build.options.progress false
Of course, set the property to true
to turn progress back on.
来源:https://stackoverflow.com/questions/50187466/turning-progress-display-off-globally-for-angular-cli-v6