diff --git a/nuxt.config.ts b/nuxt.config.ts index 36d2042..54b780b 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -14,7 +14,7 @@ export default defineNuxtConfig({ console.log(`๐ŸŒ Server listening on http://${host}:${port}`) } }, - modules: ["vuetify-nuxt-module", "@vite-pwa/nuxt", "motion-v/nuxt"], + modules: ["vuetify-nuxt-module", "motion-v/nuxt"], app: { head: { titleTemplate: "%s โ€ข MonacoUSA Portal", @@ -33,99 +33,6 @@ export default defineNuxtConfig({ }, }, }, - pwa: { - registerType: 'autoUpdate', - manifest: { - name: 'MonacoUSA Portal', - short_name: 'MonacoUSA', - description: 'MonacoUSA Portal - Unified dashboard for tools and services', - theme_color: '#a31515', - background_color: '#ffffff', - display: 'standalone', - orientation: 'portrait', - start_url: '/', - scope: '/', - icons: [ - { - src: '/icons/icon-72x72.png', - sizes: '72x72', - type: 'image/png' - }, - { - src: '/icons/icon-96x96.png', - sizes: '96x96', - type: 'image/png' - }, - { - src: '/icons/icon-128x128.png', - sizes: '128x128', - type: 'image/png' - }, - { - src: '/icons/icon-144x144.png', - sizes: '144x144', - type: 'image/png' - }, - { - src: '/icons/icon-152x152.png', - sizes: '152x152', - type: 'image/png' - }, - { - src: '/icons/icon-192x192.png', - sizes: '192x192', - type: 'image/png' - }, - { - src: '/icons/icon-384x384.png', - sizes: '384x384', - type: 'image/png' - }, - { - src: '/icons/icon-512x512.png', - sizes: '512x512', - type: 'image/png' - } - ] - }, - workbox: { - navigateFallback: '/', - globPatterns: ['**/*.{js,css,html,png,jpg,jpeg,svg,ico}'], - navigateFallbackDenylist: [ - /^\/api\//, - /^\/auth\//, - /^\/login/, - /^\/dashboard/ - ], - runtimeCaching: [ - { - urlPattern: /^https:\/\/.*\.monacousa\.org\/api\/.*/i, - handler: 'NetworkFirst', - options: { - cacheName: 'api-cache', - expiration: { - maxEntries: 10, - maxAgeSeconds: 60 * 5 // 5 minutes for API calls - }, - cacheableResponse: { - statuses: [0, 200] - } - } - } - ], - skipWaiting: true, - clientsClaim: true, - cleanupOutdatedCaches: true - }, - client: { - installPrompt: true, - periodicSyncForUpdates: 20 - }, - devOptions: { - enabled: true, - type: 'module' - } - }, nitro: { experimental: { wasm: true diff --git a/plugins/02.unregister-sw.client.ts b/plugins/02.unregister-sw.client.ts new file mode 100644 index 0000000..42272ce --- /dev/null +++ b/plugins/02.unregister-sw.client.ts @@ -0,0 +1,19 @@ +// Plugin to unregister any existing service workers +export default defineNuxtPlugin(async () => { + if (process.client && 'serviceWorker' in navigator) { + try { + const registrations = await navigator.serviceWorker.getRegistrations(); + + for (const registration of registrations) { + console.log('๐Ÿงน Unregistering service worker:', registration.scope); + await registration.unregister(); + } + + if (registrations.length > 0) { + console.log('โœ… All service workers unregistered'); + } + } catch (error) { + console.error('โŒ Error unregistering service workers:', error); + } + } +});