build for web server

This commit is contained in:
2026-02-25 01:19:47 +01:00
parent 9c8cdb3845
commit 760969f8f8
39 changed files with 189806 additions and 53 deletions

View File

@@ -0,0 +1,31 @@
'use strict';
self.addEventListener('install', () => {
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
event.waitUntil(
(async () => {
try {
await self.registration.unregister();
} catch (e) {
console.warn('Failed to unregister the service worker:', e);
}
try {
const clients = await self.clients.matchAll({
type: 'window',
});
// Reload clients to ensure they are not using the old service worker.
clients.forEach((client) => {
if (client.url && 'navigate' in client) {
client.navigate(client.url);
}
});
} catch (e) {
console.warn('Failed to navigate some service worker clients:', e);
}
})()
);
});