add ultraviolet support (bare-client-custom)

This commit is contained in:
CoolElectronics 2023-08-11 14:47:59 -04:00
parent 091339a8a0
commit 3e8f9bcf3b
No known key found for this signature in database
GPG key ID: F63593D168636C50
19 changed files with 379 additions and 9 deletions

14
client/sw.js Normal file
View file

@ -0,0 +1,14 @@
/*global UVServiceWorker,__uv$config*/
/*
* Stock service worker script.
* Users can provide their own sw.js if they need to extend the functionality of the service worker.
* Ideally, this will be registered under the scope in uv.config.js so it will not need to be modified.
* However, if a user changes the location of uv.bundle.js/uv.config.js or sw.js is not relative to them, they will need to modify this script locally.
*/
importScripts('uv/uv.bundle.js');
importScripts('uv.config.js');
importScripts(__uv$config.sw || 'uv.sw.js');
const sw = new UVServiceWorker();
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));