diff --git a/scripts/build-plugins/service-worker.js b/scripts/build-plugins/service-worker.js index a6817278..bd7d29d0 100644 --- a/scripts/build-plugins/service-worker.js +++ b/scripts/build-plugins/service-worker.js @@ -115,7 +115,6 @@ function replaceCacheFilenamesInServiceWorker(swChunk, unhashedFilenames, assets swSource = replaceArrayInSource("UNHASHED_PRECACHED_ASSETS", unhashedPreCachedAssets); swSource = replaceArrayInSource("HASHED_PRECACHED_ASSETS", hashedPreCachedAssets); swSource = replaceArrayInSource("HASHED_CACHED_ON_REQUEST_ASSETS", hashedCachedOnRequestAssets); - swSource = replaceStringInSource("NOTIFICATION_BADGE_ICON", assets.find(a => a.name === "icon.png").fileName); return swSource; } diff --git a/src/platform/web/sw.js b/src/platform/web/sw.js index 3404275d..6b864444 100644 --- a/src/platform/web/sw.js +++ b/src/platform/web/sw.js @@ -15,10 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import NOTIFICATION_BADGE_ICON from "./assets/icon.png?url"; +// replaced by the service worker build plugin const UNHASHED_PRECACHED_ASSETS = []; const HASHED_PRECACHED_ASSETS = []; const HASHED_CACHED_ON_REQUEST_ASSETS = []; -const NOTIFICATION_BADGE_ICON = "assets/icon.png"; + const unhashedCacheName = `hydrogen-assets-${HYDROGEN_GLOBAL_HASH}`; const hashedCacheName = `hydrogen-assets`; const mediaThumbnailCacheName = `hydrogen-media-thumbnails-v2`;