Skip to content

Commit 2443fd4

Browse files
alan-agius4filipesilva
authored andcommitted
fix(@angular-devkit/build-angular): flatten child compilation errors and warnings
Closes #18231
1 parent 00e1115 commit 2443fd4

File tree

1 file changed

+8
-5
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/utilities

1 file changed

+8
-5
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/utilities/stats.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ export function statsWarningsToString(json: any, statsConfig: any) {
9696
const y = (x: string) => colors ? bold(yellow(x)) : x;
9797
const warnings = [...json.warnings];
9898
if (json.children) {
99-
warnings.push(...json.children.map((c: any) => c.warnings));
99+
warnings.push(...json.children
100+
.map((c: any) => c.warnings)
101+
.reduce((a: string[], b: string[]) => [...a, ...b], [])
102+
);
100103
}
101104

102105
return rs('\n' + warnings
103-
.filter(m => !!m)
104106
.map((warning: any) => `${warning}`)
105107
.filter((warning: string) => !ERRONEOUS_WARNINGS.some((erroneous) => erroneous.test(warning)))
106108
.map((warning: string) => y(`WARNING in ${warning}`))
@@ -113,11 +115,12 @@ export function statsErrorsToString(json: any, statsConfig: any) {
113115
const r = (x: string) => colors ? bold(red(x)) : x;
114116
const errors = [...json.errors];
115117
if (json.children) {
116-
errors.push(...json.children.map((c: any) => c.errors));
118+
errors.push(...json.children
119+
.map((c: any) => c.errors)
120+
.reduce((a: string[], b: string[]) => [...a, ...b], [])
121+
);
117122
}
118-
119123
return rs('\n' + errors
120-
.filter(m => !!m)
121124
.map((error: any) => r(`ERROR in ${error}`))
122125
.join('\n\n')
123126
);

0 commit comments

Comments
 (0)