npmwebpackvisual-studio-2017angular-clitask-runner-explorer

Why does Task Runner in VS2017 give such verbose output for "ng build"


I create a new angular-cli project with "ng new xxx". I move to xxx and run "ng build". I normally get about 8 lines of output:

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 ]

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.

I added the angular-cli app to an empty Asp.Net core app in Visual Studio. In Visual Studio, when I double click the "build" task in Task Runner Explorer, I get a great amount of verbose output. 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.

I should mention that I don't think that it is a conflict with VS running different versions of npm, angular-cli or webpack. I already arranged the order in Tools -> Projects and Solutions -> Web Package Management -> External Web Tools. I have ".\node_modules\.bin" on top and "$(PATH)" below it. 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

Solution

  • To silence the output in build, you're looking for the --no-progress flag.

    --no-progress also works for other commands as well, such as ng test and ng serve.