removed vite-pwa
Some checks failed
linter / quality (push) Failing after 1m4s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m4s
tests / ci (8.5) (push) Failing after 1m4s

This commit is contained in:
Daan Meijer 2026-06-22 00:01:50 +02:00
parent 2b28831c2f
commit 64d6214aed
4 changed files with 127 additions and 3627 deletions

3691
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,6 @@
"typescript": "^5.2.2", "typescript": "^5.2.2",
"typescript-eslint": "^8.23.0", "typescript-eslint": "^8.23.0",
"vite": "^8.0.0", "vite": "^8.0.0",
"vite-plugin-pwa": "^1.3.0",
"vue-tsc": "^2.2.4" "vue-tsc": "^2.2.4"
}, },
"dependencies": { "dependencies": {

View File

@ -1,40 +0,0 @@
// This file is based on the one found in the laravel-notification-channels/webpush package.
// We need this to get the VAPID_PUBLIC_KEY from the .env file
const vapidPublicKey = import.meta.env.VITE_VAPID_PUBLIC_KEY;
self.addEventListener('push', (event) => {
const payload = event.data ? event.data.json() : {};
const options = {
body: payload.body,
icon: payload.icon,
badge: payload.badge,
data: {
url: payload.url,
},
};
event.waitUntil(self.registration.showNotification(payload.title, options));
});
self.addEventListener('notificationclick', (event) => {
event.notification.close();
event.waitUntil(
clients.openWindow(event.notification.data.url)
);
});
if (vapidPublicKey) {
self.addEventListener('load', async () => {
if ('serviceWorker' in navigator) {
try {
const registration = await navigator.serviceWorker.register('/sw.js');
console.log('Service worker registered.', registration);
} catch (error) {
console.error('Error registering service worker:', error);
}
}
});
}

View File

@ -35,27 +35,5 @@ export default defineConfig({
wayfinder({ wayfinder({
formVariants: true, formVariants: true,
}), }),
// VitePWA({
// registerType: 'autoUpdate',
// injectRegister: 'auto',
// workbox: {
// globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
// runtimeCaching: [
// {
// urlPattern: ({ url }) => url.pathname.startsWith('/'),
// handler: 'NetworkFirst',
// options: {
// cacheName: 'api-cache',
// cacheableResponse: {
// statuses: [0, 200],
// },
// },
// },
// ],
// },
// srcDir: 'resources/js',
// filename: 'sw.js',
// outDir: 'public',
// }),
], ],
}); });