diff --git a/package-lock.json b/package-lock.json index db71e800..9c96cfed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,6 +66,7 @@ "vite-plugin-run": "~0.5.2", "workbox-cacheable-response": "~7.1.0", "workbox-expiration": "~7.1.0", + "workbox-navigation-preload": "~7.1.0", "workbox-routing": "~7.1.0", "workbox-strategies": "~7.1.0" } diff --git a/package.json b/package.json index 27ec7562..07f8c99a 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "vite-plugin-run": "~0.5.2", "workbox-cacheable-response": "~7.1.0", "workbox-expiration": "~7.1.0", + "workbox-navigation-preload": "~7.1.0", "workbox-routing": "~7.1.0", "workbox-strategies": "~7.1.0" }, diff --git a/public/sw.js b/public/sw.js index 34ddfb89..b2ad5f54 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,5 +1,6 @@ import { CacheableResponsePlugin } from 'workbox-cacheable-response'; import { ExpirationPlugin } from 'workbox-expiration'; +import * as navigationPreload from 'workbox-navigation-preload'; import { RegExpRoute, registerRoute, Route } from 'workbox-routing'; import { CacheFirst, @@ -7,6 +8,8 @@ import { StaleWhileRevalidate, } from 'workbox-strategies'; +navigationPreload.enable(); + self.__WB_DISABLE_DEV_LOGS = true; const assetsRoute = new Route(