lex 1 anno fa
parent
commit
6980c8df39
2 ha cambiato i file con 26 aggiunte e 54 eliminazioni
  1. 25 53
      dev-dist/sw.js
  2. 1 1
      public/version.json

+ 25 - 53
dev-dist/sw.js

@@ -20,24 +20,22 @@ if (!self.define) {
   let nextDefineUri;
 
   const singleRequire = (uri, parentUri) => {
-    uri = new URL(uri + ".js", parentUri).href;
-    return registry[uri] || (
-
-        new Promise(resolve => {
-          if ("document" in self) {
-            const script = document.createElement("script");
-            script.src = uri;
-            script.onload = resolve;
-            document.head.appendChild(script);
-          } else {
-            nextDefineUri = uri;
-            importScripts(uri);
-            resolve();
-          }
-        })
-
-      .then(() => {
-        let promise = registry[uri];
+    uri = new URL(uri + '.js', parentUri).href;
+    return (
+      registry[uri] ||
+      new Promise(resolve => {
+        if ('document' in self) {
+          const script = document.createElement('script');
+          script.src = uri;
+          script.onload = resolve;
+          document.head.appendChild(script);
+        } else {
+          nextDefineUri = uri;
+          importScripts(uri);
+          resolve();
+        }
+      }).then(() => {
+        const promise = registry[uri];
         if (!promise) {
           throw new Error(`Module ${uri} didn’t register its module`);
         }
@@ -47,7 +45,10 @@ if (!self.define) {
   };
 
   self.define = (depsNames, factory) => {
-    const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
+    const uri =
+      nextDefineUri ||
+      ('document' in self ? document.currentScript.src : '') ||
+      location.href;
     if (registry[uri]) {
       // Module is already loading or loaded.
       return;
@@ -59,20 +60,16 @@ if (!self.define) {
       exports,
       require
     };
-    registry[uri] = Promise.all(depsNames.map(
-      depName => specialDeps[depName] || require(depName)
-    )).then(deps => {
+    registry[uri] = Promise.all(
+      depsNames.map(depName => specialDeps[depName] || require(depName))
+    ).then(deps => {
       factory(...deps);
       return exports;
     });
   };
 }
-<<<<<<< HEAD
-define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
-=======
 define(['./workbox-5357ef54'], function (workbox) {
-  ('use strict');
->>>>>>> startLogin
+  'use strict';
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -82,21 +79,6 @@ define(['./workbox-5357ef54'], function (workbox) {
    * requests for URLs in the manifest.
    * See https://goo.gl/S9QRab
    */
-<<<<<<< HEAD
-  workbox.precacheAndRoute([{
-    "url": "registerSW.js",
-    "revision": "3ca0b8505b4bec776b69afdba2768812"
-  }, {
-    "url": "index.html",
-    "revision": "0.dkdasl3h08"
-  }], {});
-  workbox.cleanupOutdatedCaches();
-  workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
-    allowlist: [/^\/$/]
-  }));
-
-}));
-=======
   workbox.precacheAndRoute(
     [
       {
@@ -110,20 +92,10 @@ define(['./workbox-5357ef54'], function (workbox) {
     ],
     {}
   );
-  /**
-   * https://juejin.cn/post/6844903881189621767
-   * 缓存策略 有5种
-   */
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(
     new workbox.NavigationRoute(workbox.createHandlerBoundToURL('index.html'), {
       allowlist: [/^\/$/]
-    }),
-    workbox.strategies.NetworkFirst()
-  );
-  workbox.routing.registerRoute(
-    new RegExp('.*.html|css|js'),
-    workbox.strategies.NetworkFirst()
+    })
   );
 });
->>>>>>> startLogin

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1705314457040}
+{"version":1705314621292}