File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ export default class WebpackBarPlugin extends ProgressPlugin {
42
42
this . updateProgress ( percent , message , details ) ;
43
43
} ;
44
44
45
- // Keep our state in shared ojbect
46
- if ( ! this . states [ this . options . name ] ) {
47
- this . states [ this . options . name ] = {
48
- ...DEFAULT_STATE ,
49
- color : this . options . color ,
50
- name : startCase ( this . options . name ) ,
51
- } ;
52
- }
53
-
54
45
// Reporters
55
46
this . reporters = Array . from ( this . options . reporters || [ ] ) ;
56
47
if ( this . options . reporter ) {
@@ -145,6 +136,17 @@ export default class WebpackBarPlugin extends ProgressPlugin {
145
136
}
146
137
}
147
138
139
+ hook ( 'afterPlugins' , ( ) => {
140
+ // Keep our state in shared object
141
+ if ( ! this . states [ this . options . name ] ) {
142
+ this . states [ this . options . name ] = {
143
+ ...DEFAULT_STATE ,
144
+ color : this . options . color ,
145
+ name : startCase ( this . options . name ) ,
146
+ } ;
147
+ }
148
+ } ) ;
149
+
148
150
// Hook into the compiler before a new compilation is created.
149
151
hook ( 'compile' , ( ) => {
150
152
Object . assign ( this . state , {
You can’t perform that action at this time.
0 commit comments