Skip to content

Commit 1a1e4bf

Browse files
committed
fix(@angular-devkit/build-angular): suppress duplicate 3rdpartylicenses.txt warning
Refs #16193 This detects and filters out error messages about duplicate 3rdpartylicenses.txt. This is a short-term fix intended to get us to 9.0.x release while a follow up effort will work to properly fix this bug. Left a TODO to remove this filter once a fix is ready. (cherry picked from commit 8c334d5)
1 parent d9c3bb3 commit 1a1e4bf

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
@@ -84,12 +84,20 @@ export function statsToString(json: any, statsConfig: any) {
8484
}
8585
}
8686

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

92-
return rs('\n' + json.warnings.map((warning: any) => y(`WARNING in ${warning}`)).join('\n\n'));
96+
return rs('\n' + json.warnings
97+
.map((warning: any) => `${warning}`)
98+
.filter((warning: string) => !ERRONEOUS_WARNINGS.some((erroneous) => erroneous.test(warning)))
99+
.map((warning: string) => y(`WARNING in ${warning}`))
100+
.join('\n\n'));
93101
}
94102

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

0 commit comments

Comments
 (0)