Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): flatten child compilation errors …
Browse files Browse the repository at this point in the history
…and warnings

Closes #18231
  • Loading branch information
alan-agius4 authored and filipesilva committed Jul 20, 2020
1 parent 00e1115 commit 2443fd4
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -96,11 +96,13 @@ export function statsWarningsToString(json: any, statsConfig: any) {
const y = (x: string) => colors ? bold(yellow(x)) : x;
const warnings = [...json.warnings];
if (json.children) {
warnings.push(...json.children.map((c: any) => c.warnings));
warnings.push(...json.children
.map((c: any) => c.warnings)
.reduce((a: string[], b: string[]) => [...a, ...b], [])
);
}

return rs('\n' + warnings
.filter(m => !!m)
.map((warning: any) => `${warning}`)
.filter((warning: string) => !ERRONEOUS_WARNINGS.some((erroneous) => erroneous.test(warning)))
.map((warning: string) => y(`WARNING in ${warning}`))
Expand All @@ -113,11 +115,12 @@ export function statsErrorsToString(json: any, statsConfig: any) {
const r = (x: string) => colors ? bold(red(x)) : x;
const errors = [...json.errors];
if (json.children) {
errors.push(...json.children.map((c: any) => c.errors));
errors.push(...json.children
.map((c: any) => c.errors)
.reduce((a: string[], b: string[]) => [...a, ...b], [])
);
}

return rs('\n' + errors
.filter(m => !!m)
.map((error: any) => r(`ERROR in ${error}`))
.join('\n\n')
);
Expand Down

0 comments on commit 2443fd4

Please sign in to comment.