Angular-cli: cli argument "--stats-json" makes ng build --prod to always return 0 as exit code

Created on 21 Feb 2018  路  6Comments  路  Source: angular/angular-cli

Versions

node v8.9.1
npm v5.6.0
@angular/cli: 1.6.8

macOS Sierra, Linux ubuntu

Repro steps

just run the following command in your repo and introduce some typescript errors.
ng build --prod --stats-json

Observed behavior

exit code is always 0 when --stats-json argument is used (even if there are typescript errors)

Desired behavior

exit code should be 1 or anything but 0 if the build fails or has any typescript error

Mention any other details that might be useful (optional)

devkibuild-angular low inconvenient bufix

Most helpful comment

Guys, any updates on that?
Can i help fixing it?

All 6 comments

Guys, any updates on that?
Can i help fixing it?

This problem blocks a good continuous integration!

At the moment we do 2 builds one without stats-json and after it again with stats-json. With this approach it works ok but still takes more time because of 2 builds :(

I was staring at empty /dist directory today and it took me couple of hours to figure out why that npm command does not fail the whole Gradle build anymore. The flag "stats-json" (added days ago as a good advice and best practice from local Angular guru) had to go away. I kindly ask for fixing this. It indeed is CI killer when applied.

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings