The script that starts my Angular CLI development Web server produces almost illegible error messages, such as the following.[]
I would much prefer something like this:[
Before I start digging into the oodles of configuration files associated with my Angular/CLI installation, I thought that I would start by asking for directions.
The easiest way to do it is to change characters in the output stream of the application that controls the color.
Linux bash:
ng serve | tr $INPUTCOLOR $OUTPUTCOLOR
or
ng serve | sed -r "s/$INPUTCOLOR/$OUTPUTCOLOR/g'
Windows PowerShell:
ng serve | ForEach-Object { $_ -replace $INPUTCOLOR, $OUTPUTCOLOR }
The $INPUTCOLOR
and $OUTPUTCOLOR
is needed to be set to run the code. This way every red foreground color can be changed with red background and white foreground color.
You can achieve this by adding | %{$_ -replace "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]",""}
to the end of the command. For example:
ng build | %{$_ -replace "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]",""}
Source: https://github.com/angular/angular-cli/issues/6478
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With