Browse Source

fix routing fallback

AykutSarac 3 năm trước cách đây
mục cha
commit
9e7316ab31
4 tập tin đã thay đổi với 4 bổ sung2 xóa
  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
       });
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
public/sw.js.map


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


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác