简体   繁体   English

为什么VS2017中的Task Runner会为“ ng build”提供如此详细的输出

[英]Why does Task Runner in VS2017 give such verbose output for “ng build”

I create a new angular-cli project with "ng new xxx". 我用“ ng new xxx”创建一个新的angular-cli项目。 I move to xxx and run "ng build". 我移到xxx并运行“ ng build”。 I normally get about 8 lines of output: 我通常得到大约8行输出:

Date: 2017-11-12T03:14:13.719Z
Hash: 4a82f3de6e254818919f
Time: 6413ms
chunk {inline} inline.bundle.js, inline.bundle.js.map ....
chunk {main} main.bundle.js, main.bundle.js.map ...
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map ...
chunk {styles} styles.bundle.js, styles.bundle.js.map ...
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) ...

[ ADDED: I put the project on Github - https://github.com/johnpankowicz/angular-cli-and-dotnet-core ] [添加:我将项目放在Github上-https: //github.com/johnpankowicz/angular-cli-and-dotnet-core ]

If I run the package.json "build":"ng build" script from the command line (using "npm run-script build"), I get about the same output as above. 如果我从命令行运行package.json“ build”:“ ng build”脚本(使用“ npm run-script build”),我将获得与上述大致相同的输出。

I added the angular-cli app to an empty Asp.Net core app in Visual Studio. 我将angular-cli应用程序添加到Visual Studio中的一个空Asp.Net核心应用程序中。 In Visual Studio, when I double click the "build" task in Task Runner Explorer, I get a great amount of verbose output. 在Visual Studio中,当我双击Task Runner Explorer中的“ build”任务时,会得到大量的详细输出。 I lose the initial output top of the window. 我失去了窗口顶部的初始输出。 So I don't even know how much output there is. 所以我什至不知道有多少输出。 Below is some of output (the entire amount would take pages) 以下是一些输出(整个页面需要花费页面)

How can I turn off this verbose output? 如何关闭此详细输出? It appears to be from Webpack. 它似乎来自Webpack。

I should mention that I don't think that it is a conflict with VS running different versions of npm, angular-cli or webpack. 我应该提到,我不认为与运行不同版本的npm,angular-cli或webpack的VS冲突。 I already arranged the order in Tools -> Projects and Solutions -> Web Package Management -> External Web Tools. 我已经在工具->项目和解决方案-> Web软件包管理->外部Web工具中安排了订单。 I have ".\\node_modules\\.bin" on top and "$(PATH)" below it. 我的顶部为“。\\ node_modules \\ .bin”,其下方为“ $(PATH)”。 Reversing that order doesn't help. 反转顺序无济于事。

...ngular\cli\src\app\app.component.html 11% building modules 12/14 modules 2 active ...cli\node_modules\zone.js\dist\zone.js 11% building modules 12/15 modules 3 active ...i\node_modules\core-js\es7\reflect.js 11% building modules 12/16 modules 4 active ...es\@angular\core\@angular\core.es5.js 11% building modules 12/17 modules 5 active ...gular\platform-browser-dynamic.es5.js 11% building modules 13/17 modules 4 active ...gular\platform-browser-dynamic.es5.js 11% building modules 14/17 modules 3 active ...gular\platform-browser-dynamic.es5.js 11% building modules 15/17 modules 2 active ...gular\platform-browser-dynamic.es5.js 11% building modules 16/17 modules 1 active ...es\@angular\core\@angular\core.es5.js                                          12% building modules 17/17 modules 0 active 12% building modules 17/18 modules 1 active ...wser\@angular\platform-browser.es5.js 12% building modules 17/19 modules 2 active ...S\DebugAngular\cli\src\$$_gendir lazy 12% building modules 18/19 modules 1 active ...wser\@angular\platform-browser.es5.js                                          12% building modules 19/19 modules 0 active 12% building modules 19/20 modules 1 active

To silence the output in build, you're looking for the --no-progress flag. 要使构建中的输出静音,您需要寻找--no-progress标志。

--no-progress also works for other commands as well, such as ng test and ng serve . --no-progress也适用于其他命令,例如ng testng serve

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM