-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from Flow-Works/feat/switch-uv-to-version-1011
[➕] (#168) use UV version 1.0.11
- Loading branch information
Showing
16 changed files
with
43,626 additions
and
41,269 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
// @ts-nocheck | ||
/*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.sw.js'); | ||
|
||
importScripts(`uv.config.js`); | ||
|
||
const params = new URL(self.location.href).searchParams | ||
const serverURL = atob(params.get('url')); | ||
const sw = new UVServiceWorker(serverURL); | ||
self.__uv$config.bare = `${serverURL}/bare/` | ||
|
||
importScripts('uv.bundle.js'); | ||
importScripts(__uv$config.sw || 'uv.sw.js'); | ||
|
||
const sw = new UVServiceWorker(); | ||
|
||
self.addEventListener('fetch', event => event.respondWith(sw.fetch(event))); | ||
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event))); |
Oops, something went wrong.