Skip to content

Commit 515de49

Browse files
clydinfilipesilva
authored andcommitted
revert: "revert: "fix(@angular-devkit/build-angular): suppress duplicate 3rdpartylicenses.txt warning""
This reverts commit 863067c.
1 parent 8cc566d commit 515de49

File tree

1 file changed

+9
-1
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/utilities

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,20 @@ export function statsToString(json: any, statsConfig: any) {
8686
}
8787
}
8888

89+
// TODO(#16193): Don't emit this warning in the first place rather than just suppressing it.
90+
const ERRONEOUS_WARNINGS = [
91+
/multiple assets emit different content.*3rdpartylicenses\.txt/i,
92+
];
8993
export function statsWarningsToString(json: any, statsConfig: any) {
9094
const colors = statsConfig.colors;
9195
const rs = (x: string) => colors ? reset(x) : x;
9296
const y = (x: string) => colors ? bold(yellow(x)) : x;
9397

94-
return rs('\n' + json.warnings.map((warning: any) => y(`WARNING in ${warning}`)).join('\n\n'));
98+
return rs('\n' + json.warnings
99+
.map((warning: any) => `${warning}`)
100+
.filter((warning: string) => !ERRONEOUS_WARNINGS.some((erroneous) => erroneous.test(warning)))
101+
.map((warning: string) => y(`WARNING in ${warning}`))
102+
.join('\n\n'));
95103
}
96104

97105
export function statsErrorsToString(json: any, statsConfig: any) {

0 commit comments

Comments
 (0)