File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ A function that will be called when **all** builds are finished.
123
123
124
124
This function can optionally return ` false ` as a signal to stop rendering and printing profile stats.
125
125
126
+ ### ` buildTitle `
127
+ - Default: ` BUILDING `
128
+
126
129
<h2 align =" center " >Maintainers</h2 >
127
130
128
131
<table >
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ module.exports = {
22
22
color : 'yellow' ,
23
23
showCursor : true ,
24
24
profile : true ,
25
- clear : true ,
25
+ clear : ! true ,
26
26
name : 'webpack-bar' ,
27
+ buildTitle : 'Wait' ,
27
28
} ) ,
28
29
] ,
29
30
} ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const defaults = {
24
24
showCursor : false ,
25
25
enabled : process . stdout . isTTY && ! isCI ,
26
26
done : null ,
27
+ buildTitle : 'BUILDING' ,
27
28
} ;
28
29
29
30
export default class WebpackBarPlugin extends webpack . ProgressPlugin {
@@ -157,13 +158,21 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
157
158
) ;
158
159
} ) ;
159
160
160
- if ( someRunning ) {
161
- const title = ` ${ chalk . bgBlue . black ( ' BUILDING ' ) } ` ;
162
- this . logUpdate ( `\n${ title } \n\n${ lines . join ( '\n\n' ) } ` ) ;
163
- } else if ( shouldClear ) {
161
+ if ( shouldClear && ! someRunning ) {
164
162
this . logUpdate . clear ( ) ;
163
+ return ;
164
+ }
165
+
166
+ const lLines = lines . join ( '\n\n' ) ;
167
+
168
+ if ( this . options . buildTitle ) {
169
+ const title = someRunning
170
+ ? ` ${ chalk . bgBlue . black ( ` ${ this . options . buildTitle } ` ) } `
171
+ : '' ;
172
+
173
+ this . logUpdate ( `\n${ title } \n\n${ lLines } ` ) ;
165
174
} else {
166
- this . logUpdate ( `\n\n ${ lines . join ( '\n\n' ) } ` ) ;
175
+ this . logUpdate ( `\n${ lLines } ` ) ;
167
176
}
168
177
}
169
178
}
You can’t perform that action at this time.
0 commit comments