@@ -64,19 +64,38 @@ export function printCompileTimeMessage(stat: any, lastStat: any | null) {
64
64
! lastStat . builtAt ||
65
65
stat . builtAt !== lastStat . builtAt
66
66
) {
67
- const entryName = chalk . bold ( stat . name ) ;
68
- let name = chalk . green ( entryName ) ;
67
+ // get bundle name
68
+ let name = '' ;
69
+ if ( stat . name ) {
70
+ const entryName = stat . name ;
71
+ name = chalk . green ( entryName ) ;
72
+ if ( stat . errors . length ) {
73
+ name = chalk . red ( entryName ) ;
74
+ } else if ( stat . warnings . length ) {
75
+ name = chalk . yellow ( entryName ) ;
76
+ }
77
+ name = `${ name } ` ;
78
+ }
79
+
80
+ // get log symbol
69
81
let symbol = logSymbols . success ;
70
82
if ( stat . errors . length ) {
71
- name = chalk . red ( entryName ) ;
72
83
symbol = logSymbols . error ;
73
84
} else if ( stat . warnings . length ) {
74
- name = chalk . yellow ( entryName ) ;
75
85
symbol = logSymbols . warning ;
76
86
}
87
+
88
+ // get log message
89
+ let msg = 'was rebuilt in' ;
90
+ if ( lastStat === null ) {
91
+ msg = 'was built in' ;
92
+ }
93
+
77
94
console . log (
78
95
addTimeStampToLog (
79
- `${ symbol } entry ${ name } in ${ chalk . magenta ( `${ stat . time } ms` ) } .`
96
+ `${ symbol } bundle ${ name } ${ msg } ${ chalk . magenta (
97
+ `${ stat . time } ms`
98
+ ) } .`
80
99
)
81
100
) ;
82
101
}
@@ -97,6 +116,8 @@ export const webpackStatToJsonOptions: webpack.Stats.ToJsonOptions = {
97
116
errors : true ,
98
117
warnings : true ,
99
118
modules : false ,
119
+ publicPath : false ,
120
+ depth : false ,
100
121
} ;
101
122
102
123
export function printCompileTimeMessages (
@@ -126,7 +147,7 @@ export function printCompileTimeMessages(
126
147
printCompileTimeMessage ( sj , lastStatsJson . children [ index ] ) ;
127
148
}
128
149
} ) ;
129
- } else if ( statsJson . time && statsJson . name ) {
150
+ } else if ( statsJson . time ) {
130
151
// if it is single compiler
131
152
if ( lastStatsJson === null ) {
132
153
printCompileTimeMessage ( statsJson , null ) ;
0 commit comments