try again with sw

This commit is contained in:
adueck 2024-08-14 20:04:48 -04:00
parent eae6dac86a
commit c661f0cf5f
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
// https://github.com/NekR/self-destroying-sw
self.addEventListener("install", function (e) {
self.skipWaiting();
});
self.addEventListener("activate", function (e) {
self.registration
.unregister()
.then(function () {
return self.clients.matchAll();
})
.then(function (clients) {
clients.forEach((client) => client.navigate(client.url));
});
});

View File

@ -14,7 +14,7 @@ export default defineConfig({
cleanupOutdatedCaches: true,
},
includeAssets: ["**/*.(js|html|svg|png|jpg|jpeg|eot|woff|woff2|ttf)"],
filename: "service-worker.js",
filename: "sw.js",
manifest: {
short_name: "Pashto Dictionary",
name: "LingDocs Pashto Dictionary",