Skip to content

Commit

Permalink
Create sw.js
Browse files Browse the repository at this point in the history
  • Loading branch information
crllect committed Jan 7, 2024
1 parent c1c1668 commit 0794553
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions public/uv/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
importScripts("/uv/uv.bundle.js");
importScripts("/uv/uv.config.js");
importScripts(__uv$config.sw || "/uv/uv.sw.js");

const sw = new UVServiceWorker();

self.addEventListener("fetch", (event) => {
if (event.request.url.startsWith(location.origin + __uv$config.prefix))
return event.respondWith(sw.fetch(event));
});

0 comments on commit 0794553

Please sign in to comment.