Преглед изворни кода

fix: disable pwa registerRoute

kerasus пре 2 година
родитељ
комит
68de2696a0
1 измењених фајлова са 19 додато и 19 уклоњено
  1. 19 19
      src-pwa/custom-service-worker.js

+ 19 - 19
src-pwa/custom-service-worker.js

@@ -9,10 +9,10 @@
 import { clientsClaim } from 'workbox-core'
 import {
   precacheAndRoute,
-  cleanupOutdatedCaches,
-  createHandlerBoundToURL
+  cleanupOutdatedCaches
+  // createHandlerBoundToURL
 } from 'workbox-precaching'
-import { registerRoute, NavigationRoute } from 'workbox-routing'
+// import { registerRoute, NavigationRoute } from 'workbox-routing'
 
 self.skipWaiting()
 clientsClaim()
@@ -22,19 +22,19 @@ precacheAndRoute(self.__WB_MANIFEST)
 
 cleanupOutdatedCaches()
 
-// Non-SSR fallback to index.html
-// Production SSR fallback to offline.html (except for dev)
-if (process.env.MODE !== 'ssr' || process.env.PROD) {
-  registerRoute(
-    new NavigationRoute(
-      createHandlerBoundToURL(process.env.PWA_FALLBACK_HTML),
-      {
-        denylist: [
-          /api$/,
-          /sw\.js$/,
-          /workbox-(.)*\.js$/
-        ]
-      }
-    )
-  )
-}
+// // Non-SSR fallback to index.html
+// // Production SSR fallback to offline.html (except for dev)
+// if (process.env.MODE !== 'ssr' || process.env.PROD) {
+//   registerRoute(
+//     new NavigationRoute(
+//       createHandlerBoundToURL(process.env.PWA_FALLBACK_HTML),
+//       {
+//         denylist: [
+//           /api$/,
+//           /sw\.js$/,
+//           /workbox-(.)*\.js$/
+//         ]
+//       }
+//     )
+//   )
+// }