Skip to content

Commit a9c0bfd

Browse files
committed
ensure hasErrors() and hasWarnings() check child compilations as well
1 parent c26d1f0 commit a9c0bfd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/Stats.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ class Stats {
5050
}
5151

5252
hasWarnings() {
53-
return this.compilation.warnings.length > 0;
53+
return this.compilation.warnings.length > 0 ||
54+
this.compilation.children.some(child => child.getStats().hasWarnings());
5455
}
5556

5657
hasErrors() {
57-
return this.compilation.errors.length > 0;
58+
return this.compilation.errors.length > 0 ||
59+
this.compilation.children.some(child => child.getStats().hasErrors());
5860
}
5961

6062
// remove a prefixed "!" that can be specified to reverse sort order

0 commit comments

Comments
 (0)