Skip to content

Commit e1f17c8

Browse files
committed
fix (theme): change webpack static prop for instance prop
1 parent d450a9f commit e1f17c8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

config/webpack-image-sizes-plugin.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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
// ----

0 commit comments

Comments
 (0)