parent
9a53e32691
commit
13b6b32041
1
public/sw.js
Normal file
1
public/sw.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return s[e]||(r=new Promise((async r=>{if("document"in self){const s=document.createElement("script");s.src=e,document.head.appendChild(s),s.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!s[e])throw new Error(`Module ${e} didn’t register its module`);return s[e]}))},r=(r,s)=>{Promise.all(r.map(e)).then((e=>s(1===e.length?e[0]:e)))},s={require:Promise.resolve(r)};self.define=(r,i,c)=>{s[r]||(s[r]=Promise.resolve().then((()=>{let s={};const o={uri:location.origin+r.slice(1)};return Promise.all(i.map((r=>{switch(r){case"exports":return s;case"module":return o;default:return e(r)}}))).then((e=>{const r=c(...e);return s.default||(s.default=r),s}))})))}}define("./sw.js",["./workbox-c8ead010"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"env.js",revision:"d774a7cf97a5e7390045bcf8b304062c"},{url:"env.sample.js",revision:"83a2a360688fb3ab53c67f3137a72683"},{url:"favicon.ico",revision:"ba44f340afba5bb1a07f14decc15dd04"},{url:"favicon.png",revision:"07a9941cec62319578fa2a1734db9959"},{url:"favicon.svg",revision:"689d6c6fda51e359c0e5725d9e905064"},{url:"index.html",revision:"4c19a21d81de8fd5ca73503cec356c7c"},{url:"logo.svg",revision:"4c9e31a1f4268d7e36e22cda7656e561"},{url:"robots.txt",revision:"61c27d2cd39a713f7829422c3d9edcc7"}],{})}));
|
1
public/workbox-c8ead010.js
Normal file
1
public/workbox-c8ead010.js
Normal file
File diff suppressed because one or more lines are too long
@ -50,6 +50,18 @@
|
|||||||
"*": NotFound,
|
"*": NotFound,
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
|
if ("serviceWorker" in navigator) {
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
navigator.serviceWorker.register("/sw.js").then(
|
||||||
|
(registration) => {
|
||||||
|
console.log(`sw successful with scope: ${registration.scope}`);
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
console.log(`sw failed: ${err}`);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Router {routes} />
|
<Router {routes} />
|
||||||
|
7
workbox-config.js
Normal file
7
workbox-config.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
"globDirectory": "public/",
|
||||||
|
"globPatterns": [
|
||||||
|
"**/*.{js,ico,png,svg,html,txt}"
|
||||||
|
],
|
||||||
|
"swDest": "public/sw.js"
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user