Quellcode durchsuchen

fix routing fallback

AykutSarac vor 3 Jahren
Ursprung
Commit
9e7316ab31
4 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 3 1
      next.config.js
  2. 1 1
      public/fallback-development.js
  3. 0 0
      public/sw.js.map
  4. 0 0
      src/pages/editor/index.tsx

+ 3 - 1
next.config.js

@@ -13,9 +13,11 @@ const nextConfig = {
     styledComponents: true,
   },
   pwa: {
-    disable: process.env.NODE_ENV === "development",
     dest: "public",
     register: true,
+    fallbacks: {
+      document: "/editor",
+    },
   },
 };
 

+ 1 - 1
public/fallback-development.js

@@ -7,7 +7,7 @@ self.fallback = async request => {
   // https://developer.mozilla.org/en-US/docs/Web/API/RequestDestination
   switch (request.destination) {
     case 'document':
-      if (true) return caches.match("/_offline", {
+      if (true) return caches.match("/editor", {
         ignoreSearch: true
       });
 

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
public/sw.js.map


+ 0 - 0
src/pages/_offline.tsx → src/pages/editor/index.tsx


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.