mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Add UV
This commit is contained in:
parent
5ae0aad1d6
commit
3b00a749b5
13 changed files with 5887 additions and 2913 deletions
20
public/sw.js
Normal file
20
public/sw.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
importScripts('/epoxy/index.js');
|
||||
importScripts('/uv/uv.bundle.js');
|
||||
importScripts('/uv/uv.config.js');
|
||||
importScripts(__uv$config.sw || '/uv/uv.sw.js');
|
||||
const uv = new UVServiceWorker();
|
||||
self.addEventListener('fetch', function (event) {
|
||||
if (event.request.url.startsWith(location.origin + __uv$config.prefix)) {
|
||||
event.respondWith(
|
||||
(async function () {
|
||||
return await uv.fetch(event);
|
||||
})()
|
||||
);
|
||||
} else {
|
||||
event.respondWith(
|
||||
(async function () {
|
||||
return await fetch(event.request);
|
||||
})()
|
||||
);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue