From 38d8513f97983698b3b4417abb8bacaee0ea68fb Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Fri, 17 Mar 2023 02:54:47 +0300 Subject: [PATCH] fix: don't invalidate cache after timeout refresh (#1023) --- src/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 8a9d6d71..36c08e98 100644 --- a/src/index.js +++ b/src/index.js @@ -210,11 +210,16 @@ class MiniCssExtractPlugin { */ updateCacheModule(module) { if ( - this.content !== /** @type {CssModule} */ (module).content || + !this.content.equals(/** @type {CssModule} */ (module).content) || this.layer !== /** @type {CssModule} */ (module).layer || this.supports !== /** @type {CssModule} */ (module).supports || this.media !== /** @type {CssModule} */ (module).media || - this.sourceMap !== /** @type {CssModule} */ (module).sourceMap || + (this.sourceMap + ? !this.sourceMap.equals( + /** @type {Uint8Array} **/ + (/** @type {CssModule} */ (module).sourceMap) + ) + : false) || this.assets !== /** @type {CssModule} */ (module).assets || this.assetsInfo !== /** @type {CssModule} */ (module).assetsInfo ) {