Skip to content

Commit ad38f19

Browse files
authored
feat: use UV version 1.0.11
1 parent 159787b commit ad38f19

14 files changed

+43623
-41266
lines changed

public/uv-sw.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
// @ts-nocheck
1+
/*global UVServiceWorker,__uv$config*/
2+
/*
3+
* Stock service worker script.
4+
* Users can provide their own sw.js if they need to extend the functionality of the service worker.
5+
* Ideally, this will be registered under the scope in uv.config.js so it will not need to be modified.
6+
* 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.
7+
*/
28

3-
importScripts('/uv/uv.sw.js');
9+
10+
importScripts(`uv.config.js`);
411

512
const params = new URL(self.location.href).searchParams
613
const serverURL = atob(params.get('url'));
7-
const sw = new UVServiceWorker(serverURL);
14+
self.__uv$config.bare = `${serverURL}/bare/`
15+
16+
importScripts('uv.bundle.js');
17+
importScripts(__uv$config.sw || 'uv.sw.js');
18+
19+
const sw = new UVServiceWorker();
820

9-
self.addEventListener('fetch', event => event.respondWith(sw.fetch(event)));
21+
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));

0 commit comments

Comments
 (0)