mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
full service-worker caching
This commit is contained in:
parent
753bccf51b
commit
ebe1f18b68
7 changed files with 418 additions and 16 deletions
|
@ -1,14 +0,0 @@
|
|||
/*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)));
|
Loading…
Add table
Add a link
Reference in a new issue