kopia lustrzana https://github.com/Tldraw/Tldraw
Have file association working, where it now shows up as Recommended app. Icon isn't changing though, I think I have VS Code as the default handler though. Looking into it
rodzic
e081d07482
commit
fc8c908e24
|
@ -391,3 +391,11 @@ For this reason, many sessions begin by taking a snapshot of the current draft.
|
||||||
|
|
||||||
### PWA Support
|
### PWA Support
|
||||||
Tldraw can be installed as PWA via browsers on mobile and desktop.
|
Tldraw can be installed as PWA via browsers on mobile and desktop.
|
||||||
|
|
||||||
|
**How to install/uninstall PWAs**
|
||||||
|
- Chrome
|
||||||
|
- Desktop ([Install]](https://support.google.com/chrome/answer/9658361?hl=en&co=GENIE.Platform%3DDesktop) / [Uninstall](chrome://apps/) )
|
||||||
|
- TODO: Add link to mobile instructions
|
||||||
|
- Safari
|
||||||
|
- TODO: Adds link to mobile instructions
|
||||||
|
- TODO: Document major browsers like Firefox/Edge.
|
|
@ -20,7 +20,6 @@ const isProduction = NODE_ENV === 'production'
|
||||||
|
|
||||||
module.exports = withPWA({
|
module.exports = withPWA({
|
||||||
pwa: {
|
pwa: {
|
||||||
disable: !isProduction,
|
|
||||||
dest: 'public',
|
dest: 'public',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 4.2 KiB |
|
@ -31,5 +31,20 @@
|
||||||
"background_color": "#fafafa",
|
"background_color": "#fafafa",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"orientation": "portrait"
|
"orientation": "portrait",
|
||||||
|
"file_handlers": [
|
||||||
|
{
|
||||||
|
"action": "/",
|
||||||
|
"name": "Tldraw ",
|
||||||
|
"accept": {
|
||||||
|
"application/tldraw": [ ".tldr" ]
|
||||||
|
},
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/desktop-chrome-maskable-144x144.png",
|
||||||
|
"sizes": "192x192"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
634
public/sw.js
634
public/sw.js
|
@ -1,528 +1,128 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// If the loader is already loaded, just stop.
|
||||||
if (!self.define) {
|
if (!self.define) {
|
||||||
const e = (e) => {
|
const singleRequire = name => {
|
||||||
'require' !== e && (e += '.js')
|
if (name !== 'require') {
|
||||||
let s = Promise.resolve()
|
name = name + '.js';
|
||||||
return (
|
}
|
||||||
i[e] ||
|
let promise = Promise.resolve();
|
||||||
(s = new Promise(async (s) => {
|
if (!registry[name]) {
|
||||||
if ('document' in self) {
|
|
||||||
const i = document.createElement('script')
|
promise = new Promise(async resolve => {
|
||||||
;(i.src = e), document.head.appendChild(i), (i.onload = s)
|
if ("document" in self) {
|
||||||
} else importScripts(e), s()
|
const script = document.createElement("script");
|
||||||
})),
|
script.src = name;
|
||||||
s.then(() => {
|
document.head.appendChild(script);
|
||||||
if (!i[e]) throw new Error(`Module ${e} didn’t register its module`)
|
script.onload = resolve;
|
||||||
return i[e]
|
} else {
|
||||||
})
|
importScripts(name);
|
||||||
)
|
resolve();
|
||||||
},
|
}
|
||||||
s = (s, i) => {
|
});
|
||||||
Promise.all(s.map(e)).then((e) => i(1 === e.length ? e[0] : e))
|
|
||||||
},
|
}
|
||||||
i = { require: Promise.resolve(s) }
|
return promise.then(() => {
|
||||||
self.define = (s, c, t) => {
|
if (!registry[name]) {
|
||||||
i[s] ||
|
throw new Error(`Module ${name} didn’t register its module`);
|
||||||
(i[s] = Promise.resolve().then(() => {
|
}
|
||||||
let i = {}
|
return registry[name];
|
||||||
const n = { uri: location.origin + s.slice(1) }
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const require = (names, resolve) => {
|
||||||
|
Promise.all(names.map(singleRequire))
|
||||||
|
.then(modules => resolve(modules.length === 1 ? modules[0] : modules));
|
||||||
|
};
|
||||||
|
|
||||||
|
const registry = {
|
||||||
|
require: Promise.resolve(require)
|
||||||
|
};
|
||||||
|
|
||||||
|
self.define = (moduleName, depsNames, factory) => {
|
||||||
|
if (registry[moduleName]) {
|
||||||
|
// Module is already loading or loaded.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
registry[moduleName] = Promise.resolve().then(() => {
|
||||||
|
let exports = {};
|
||||||
|
const module = {
|
||||||
|
uri: location.origin + moduleName.slice(1)
|
||||||
|
};
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
c.map((s) => {
|
depsNames.map(depName => {
|
||||||
switch (s) {
|
switch(depName) {
|
||||||
case 'exports':
|
case "exports":
|
||||||
return i
|
return exports;
|
||||||
case 'module':
|
case "module":
|
||||||
return n
|
return module;
|
||||||
default:
|
default:
|
||||||
return e(s)
|
return singleRequire(depName);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
).then((e) => {
|
).then(deps => {
|
||||||
const s = t(...e)
|
const facValue = factory(...deps);
|
||||||
return i.default || (i.default = s), i
|
if(!exports.default) {
|
||||||
})
|
exports.default = facValue;
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
return exports;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
define('./sw.js', ['./workbox-ea903bce'], function (e) {
|
define("./sw.js",['./workbox-6b19f60b'], function (workbox) { 'use strict';
|
||||||
'use strict'
|
|
||||||
importScripts('worker-6L8AMbRb0NKpPgic9tDJq.js'),
|
/**
|
||||||
self.skipWaiting(),
|
* Welcome to your Workbox-powered service worker!
|
||||||
e.clientsClaim(),
|
*
|
||||||
e.precacheAndRoute(
|
* You'll need to register this file in your web app.
|
||||||
[
|
* See https://goo.gl/nhQhGp
|
||||||
{
|
*
|
||||||
url: '/VerveineRegular.woff',
|
* The rest of the code is auto-generated. Please don't update this file
|
||||||
revision: '858cc7add1765cbcfb0439e275fd167b',
|
* directly; instead, make changes to your Workbox build configuration
|
||||||
},
|
* and re-run your build process.
|
||||||
{
|
* See https://goo.gl/2aRDsh
|
||||||
url: '/_next/static/6L8AMbRb0NKpPgic9tDJq/_buildManifest.js',
|
*/
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
importScripts("worker-development.js");
|
||||||
{
|
self.skipWaiting();
|
||||||
url: '/_next/static/6L8AMbRb0NKpPgic9tDJq/_ssgManifest.js',
|
workbox.clientsClaim();
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
workbox.registerRoute("/", new workbox.NetworkFirst({
|
||||||
},
|
"cacheName": "start-url",
|
||||||
{
|
plugins: [{
|
||||||
url: '/_next/static/chunks/245.0b8b5b2c6276314320c8.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/245.0b8b5b2c6276314320c8.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/249-6f03b7a81bcbd0038729.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/249-6f03b7a81bcbd0038729.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/326-3c7a0e1d438e42f6840a.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/326-3c7a0e1d438e42f6840a.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/433-4af653dbe4f101dcf043.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/433-4af653dbe4f101dcf043.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/448.75c2f81459cefda29a33.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/448.75c2f81459cefda29a33.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/500.add46b3673e39a4bea2f.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/500.add46b3673e39a4bea2f.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/517-ef5a73f6d009b76efe08.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/517-ef5a73f6d009b76efe08.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/605.f3864658d8634b76f25b.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/605.f3864658d8634b76f25b.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/679.243b85dfdec37fa00017.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/679.243b85dfdec37fa00017.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/725.ba6f1f8d1ef9761d5764.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/725.ba6f1f8d1ef9761d5764.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/768.3eb2d8f1c748e19b3191.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/768.3eb2d8f1c748e19b3191.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/847.bd02d1a1772e5f87b99d.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/847.bd02d1a1772e5f87b99d.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/94.a2f19400fba005dc6c4f.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/94.a2f19400fba005dc6c4f.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/945.27ce1a50bfc1ce339fd4.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/945.27ce1a50bfc1ce339fd4.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/965.d0b65414f207ca0dc6a2.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/965.d0b65414f207ca0dc6a2.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/ee9ce975.ee18cda6cbd28d404e39.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/ee9ce975.ee18cda6cbd28d404e39.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/framework-0fd486a5f941532fdde0.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/framework-0fd486a5f941532fdde0.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/main-e948a5ffef40ef3bf54a.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/main-e948a5ffef40ef3bf54a.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/_app-a1d000020e93919862ee.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/_app-a1d000020e93919862ee.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/_error-fa66bd2a1f1976f8f4ba.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/_error-fa66bd2a1f1976f8f4ba.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/create-error-dbbfb7ded30741dbea75.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/create-error-dbbfb7ded30741dbea75.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/index-77ea2f4dd2a17b027e3c.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/index-77ea2f4dd2a17b027e3c.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/shhh-c685061b2f91817cb318.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/shhh-c685061b2f91817cb318.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/signout-1aa15c2b9eebca4b25ca.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/signout-1aa15c2b9eebca4b25ca.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/sponsorware-7ed3c2cbeca2692c04bd.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/pages/sponsorware-7ed3c2cbeca2692c04bd.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/polyfills-2eea1e1f8ec955b73e03.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/polyfills-2eea1e1f8ec955b73e03.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/webpack-781ce7a400ed0d5cf690.js',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/chunks/webpack-781ce7a400ed0d5cf690.js.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/css/50297e5ab72b54dddbcb.css',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/_next/static/css/50297e5ab72b54dddbcb.css.map',
|
|
||||||
revision: '6L8AMbRb0NKpPgic9tDJq',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/android-chrome-192x192.png',
|
|
||||||
revision: '57c9c4cd91d24d48b7ffdda0768fd225',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/android-chrome-512x512.png',
|
|
||||||
revision: '8d2454e6cf551f8ca1e1d5670b13a8d1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/android-chrome-maskable-192x192.png',
|
|
||||||
revision: '71c93ce0b34d2fbb4c6654a9131a3d9d',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/android-chrome-maskable-512x512.png',
|
|
||||||
revision: '4265b8c09997b16ac1493500b43f3755',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/apple-touch-icon.png',
|
|
||||||
revision: '8081d08be3673ec33dbeecab06706b2b',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/favicon-16x16.png',
|
|
||||||
revision: 'ac17d75b1ee007781212853a57b88285',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/favicon-32x32.png',
|
|
||||||
revision: '360bc7cd4706c0657917f3b78fed6b71',
|
|
||||||
},
|
|
||||||
{ url: '/favicon.ico', revision: 'b2bf6bb7b4d0234f3e6df44fd7d5707e' },
|
|
||||||
{ url: '/flat.png', revision: 'e0460141713b5c94104ce19b36c4b462' },
|
|
||||||
{
|
|
||||||
url: '/icons/grab.svg',
|
|
||||||
revision: 'a1ca9e5c31d1edd2558ab075f72fde4e',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/icons/pointer.svg',
|
|
||||||
revision: 'dff260f896fe23adb83341639fdf93be',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/icons/resize.svg',
|
|
||||||
revision: '0a3cb701d15731e25919783801d18f95',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '/images/hello.mp4',
|
|
||||||
revision: 'b716f249cc6c781c91b0ac9dc23423b3',
|
|
||||||
},
|
|
||||||
{ url: '/manifest.json', revision: '3e9972cc640a3e24648a6620cfc03650' },
|
|
||||||
],
|
|
||||||
{ ignoreURLParametersMatching: [] }
|
|
||||||
),
|
|
||||||
e.cleanupOutdatedCaches(),
|
|
||||||
e.registerRoute(
|
|
||||||
'/',
|
|
||||||
new e.NetworkFirst({
|
|
||||||
cacheName: 'start-url',
|
|
||||||
plugins: [
|
|
||||||
{
|
|
||||||
cacheWillUpdate: async ({
|
cacheWillUpdate: async ({
|
||||||
request: e,
|
request,
|
||||||
response: s,
|
response,
|
||||||
event: i,
|
event,
|
||||||
state: c,
|
state
|
||||||
}) =>
|
}) => {
|
||||||
s && 'opaqueredirect' === s.type
|
if (response && response.type === 'opaqueredirect') {
|
||||||
? new Response(s.body, {
|
return new Response(response.body, {
|
||||||
status: 200,
|
status: 200,
|
||||||
statusText: 'OK',
|
statusText: 'OK',
|
||||||
headers: s.headers,
|
headers: response.headers
|
||||||
})
|
});
|
||||||
: s,
|
}
|
||||||
},
|
|
||||||
],
|
return response;
|
||||||
}),
|
}
|
||||||
'GET'
|
}]
|
||||||
),
|
}), 'GET');
|
||||||
e.registerRoute(
|
workbox.registerRoute(/.*/i, new workbox.NetworkOnly({
|
||||||
/^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,
|
"cacheName": "dev",
|
||||||
new e.CacheFirst({
|
plugins: []
|
||||||
cacheName: 'google-fonts',
|
}), 'GET');
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
});
|
||||||
maxEntries: 4,
|
|
||||||
maxAgeSeconds: 31536e3,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'static-font-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 4,
|
|
||||||
maxAgeSeconds: 604800,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'static-image-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 64,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\/_next\/image\?url=.+$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'next-image',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 64,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:mp3|mp4)$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'static-media-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:js)$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'static-js-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:css|less)$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'static-style-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\/_next\/data\/.+\/.+\.json$/i,
|
|
||||||
new e.StaleWhileRevalidate({
|
|
||||||
cacheName: 'next-data',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
/\.(?:json|xml|csv)$/i,
|
|
||||||
new e.NetworkFirst({
|
|
||||||
cacheName: 'static-data-assets',
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
({ url: e }) => {
|
|
||||||
if (!(self.origin === e.origin)) return !1
|
|
||||||
const s = e.pathname
|
|
||||||
return !s.startsWith('/api/auth/') && !!s.startsWith('/api/')
|
|
||||||
},
|
|
||||||
new e.NetworkFirst({
|
|
||||||
cacheName: 'apis',
|
|
||||||
networkTimeoutSeconds: 10,
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 16,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
),
|
|
||||||
e.registerRoute(
|
|
||||||
({ url: e }) => {
|
|
||||||
if (!(self.origin === e.origin)) return !1
|
|
||||||
return !e.pathname.startsWith('/api/')
|
|
||||||
},
|
|
||||||
new e.NetworkFirst({
|
|
||||||
cacheName: 'others',
|
|
||||||
networkTimeoutSeconds: 10,
|
|
||||||
plugins: [
|
|
||||||
new e.ExpirationPlugin({
|
|
||||||
maxEntries: 32,
|
|
||||||
maxAgeSeconds: 86400,
|
|
||||||
purgeOnQuotaError: !0,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
'GET'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
//# sourceMappingURL=sw.js.map
|
//# sourceMappingURL=sw.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
Plik diff jest za duży
Load Diff
File diff suppressed because one or more lines are too long
Plik diff jest za duży
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
self.__WB_DISABLE_DEV_LOGS = !0
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
var __webpack_exports__ = {};
|
||||||
|
self.__WB_DISABLE_DEV_LOGS = true;
|
||||||
|
/******/ })()
|
||||||
|
;
|
Ładowanie…
Reference in New Issue