为 angular-cli v6 全局关闭进度显示 [英] Turning progress display off globally for angular-cli v6

查看:22
本文介绍了为 angular-cli v6 全局关闭进度显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已升级到 Angular 6.现在我想为 ng build 全局关闭进度显示.但是,有关 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 文件中,如果将 progress 选项放在 build 内的 options 键下,则该选项有效.然而,它似乎在 ~/.angular.json 文件中被忽略,即使包含在 options 中.

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 全局关闭进度显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆