Skip to content

Commit 59c9802

Browse files
dgp1130Keen Yee Liau
authored and
Keen Yee Liau
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.
1 parent 302a9f3 commit 59c9802

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,20 @@ export function statsToString(json: any, statsConfig: any) {
8585
}
8686
}
8787

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

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

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

0 commit comments

Comments
 (0)