File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ class WebpackImageSizesPlugin {
47
47
silence : false ,
48
48
...options ,
49
49
}
50
+
51
+ this . hasBeenBuiltOnce = false
50
52
}
51
53
52
54
/**
@@ -82,15 +84,15 @@ class WebpackImageSizesPlugin {
82
84
83
85
// Check if there are any changes in the conf-img directory
84
86
// Assumes that no modified files means the start of the build (yarn start || yarn build)
85
- if ( WebpackImageSizesPlugin . hasBeenBuiltOnce && compilation . modifiedFiles ) {
87
+ if ( this . hasBeenBuiltOnce && compilation . modifiedFiles ) {
86
88
for ( const filePath of compilation . modifiedFiles ) {
87
89
if ( filePath . includes ( this . options . confImgPath ) ) {
88
90
hasChanges = true
89
91
}
90
92
}
91
93
}
92
94
93
- if ( WebpackImageSizesPlugin . hasBeenBuiltOnce && ! hasChanges ) {
95
+ if ( this . hasBeenBuiltOnce && ! hasChanges ) {
94
96
this . log ( 'log' , `✅ No changes detected in ${ this . options . confImgPath } ` )
95
97
96
98
if ( callback ) {
@@ -100,7 +102,7 @@ class WebpackImageSizesPlugin {
100
102
return
101
103
}
102
104
103
- WebpackImageSizesPlugin . hasBeenBuiltOnce = true
105
+ this . hasBeenBuiltOnce = true
104
106
105
107
this . log ( 'log' , '🔧 Starting WebpackImageSizesPlugin generation...' )
106
108
@@ -544,11 +546,6 @@ class WebpackImageSizesPlugin {
544
546
}
545
547
}
546
548
547
- // ----
548
- // static properties
549
- // ----
550
- WebpackImageSizesPlugin . hasBeenBuiltOnce = false
551
-
552
549
// ----
553
550
// export
554
551
// ----
You can’t perform that action at this time.
0 commit comments