0

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
John Pankowicz
  • 3,346
  • 2
  • 22
  • 40

1 Answers1

1

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.

delasteve
  • 2,389
  • 2
  • 15
  • 10
  • Thanks. Yes that did it. I thought I had already tried setting the "--progress=false" option, which I see also has the same result. But I must had did something wrong. It seems that Task Runner must turn on --progress, since if I type "ng build" with no options on the command line, it does not display progress. – John Pankowicz Nov 14 '17 at 03:40
  • By default, progress is shown. So, you should see progress when just using `ng build` in the command line. It may be quick (as a test, try the `-prod` flag to take more time during compilation). The progress of webpack uses control sequences to rewrite the terminal line and appear as a single line rather than spam your terminal window. Unfortunately, some CI systems (e.g. TravisCI, Jenkins, etc) and some editors (VS, in this case) are unable to handle these causing the "spam" you saw without the flag. – delasteve Nov 14 '17 at 03:51
  • Yes that exactly explains what's happening. The progress line happens so fast, I didn't imagine that was that was the cause of what I was seeing in Task Runner. There were over 50K characters in the output pane. Thanks again. – John Pankowicz Nov 14 '17 at 04:04
  • No problem :) Best of luck! – delasteve Nov 14 '17 at 04:05