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 {
4747 silence : false ,
4848 ...options ,
4949 }
50+
51+ this . hasBeenBuiltOnce = false
5052 }
5153
5254 /**
@@ -82,15 +84,15 @@ class WebpackImageSizesPlugin {
8284
8385 // Check if there are any changes in the conf-img directory
8486 // 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 ) {
8688 for ( const filePath of compilation . modifiedFiles ) {
8789 if ( filePath . includes ( this . options . confImgPath ) ) {
8890 hasChanges = true
8991 }
9092 }
9193 }
9294
93- if ( WebpackImageSizesPlugin . hasBeenBuiltOnce && ! hasChanges ) {
95+ if ( this . hasBeenBuiltOnce && ! hasChanges ) {
9496 this . log ( 'log' , `✅ No changes detected in ${ this . options . confImgPath } ` )
9597
9698 if ( callback ) {
@@ -100,7 +102,7 @@ class WebpackImageSizesPlugin {
100102 return
101103 }
102104
103- WebpackImageSizesPlugin . hasBeenBuiltOnce = true
105+ this . hasBeenBuiltOnce = true
104106
105107 this . log ( 'log' , '🔧 Starting WebpackImageSizesPlugin generation...' )
106108
@@ -544,11 +546,6 @@ class WebpackImageSizesPlugin {
544546 }
545547}
546548
547- // ----
548- // static properties
549- // ----
550- WebpackImageSizesPlugin . hasBeenBuiltOnce = false
551-
552549// ----
553550// export
554551// ----
You can’t perform that action at this time.
0 commit comments