File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,23 @@ export default class StatsReporter {
14
14
}
15
15
16
16
done ( context , { stats } ) {
17
- context . state . statsString = stats . toString ( this . options ) ;
17
+ const str = stats . toString ( this . options ) ;
18
+
19
+ if ( stats . hasErrors ( ) ) {
20
+ process . stderr . write ( '\n' + str + '\n' ) ;
21
+ } else {
22
+ context . state . statsString = str ;
23
+ }
18
24
}
19
25
20
26
allDone ( context ) {
21
27
let str = '' ;
22
-
23
- context . statesArray . forEach ( ( state ) => {
24
- str += '\n' + state . statsString + '\n' ;
25
- delete state . statsString ;
26
- } ) ;
27
-
28
+ for ( const state in context . statesArray ) {
29
+ if ( state . statsString ) {
30
+ str += '\n' + state . statsString + '\n' ;
31
+ delete state . statsString ;
32
+ }
33
+ }
28
34
process . stderr . write ( str ) ;
29
35
}
30
36
}
You can’t perform that action at this time.
0 commit comments