Complete PWA implementation with custom icons
- Add PWA icons in multiple sizes (192px, 512px, maskable) - Configure manifest.webmanifest with proper icon references - Implement PWA install prompt with custom notification - Add manual manifest route for development compatibility - Update meta tags for iOS and Android PWA support - Configure service worker with music and image caching - Enable auto-updates and offline functionality PWA now fully installable on all platforms with proper branding.
This commit is contained in:
@@ -26,9 +26,14 @@ export default defineNuxtConfig({
|
||||
'@vueuse/nuxt',
|
||||
['@vite-pwa/nuxt', {
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: ['favicon.ico', 'logo.png', 'logo-192.png', 'logo-512.png', 'logo-maskable-512.png', 'icon.svg'],
|
||||
workbox: {
|
||||
navigateFallback: '/',
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
||||
globPatterns: [
|
||||
'**/*.{js,css,html,ico,png,svg}',
|
||||
'_nuxt/**/*.{js,css}',
|
||||
'assets/**/*.{png,jpg,jpeg,svg,gif,webp}'
|
||||
],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /^https?:\/\/.*\/api\/music\/.*/i,
|
||||
@@ -40,38 +45,67 @@ export default defineNuxtConfig({
|
||||
maxAgeSeconds: 60 * 60 * 24 * 30 // 30 days
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
urlPattern: /\.(png|jpg|jpeg|svg|gif|webp)$/,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'images-cache',
|
||||
expiration: {
|
||||
maxEntries: 50,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 7 // 7 days
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
client: {
|
||||
installPrompt: true
|
||||
installPrompt: true,
|
||||
periodicSyncForUpdates: 20
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
type: 'module',
|
||||
navigateFallback: '/'
|
||||
},
|
||||
mode: 'development',
|
||||
manifest: {
|
||||
name: 'RepoDructor Music Player',
|
||||
short_name: 'RepoDructor',
|
||||
description: 'A beautiful glassmorphism music player for your local network',
|
||||
theme_color: '#3b82f6',
|
||||
theme_color: '#8b5cf6', // Purple from logo gradient
|
||||
background_color: '#0f172a',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
categories: ['music', 'entertainment'],
|
||||
lang: 'es',
|
||||
dir: 'ltr',
|
||||
icons: [
|
||||
{
|
||||
src: 'icon.svg',
|
||||
src: '/logo-192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/svg+xml'
|
||||
type: 'image/png',
|
||||
purpose: 'any'
|
||||
},
|
||||
{
|
||||
src: 'icon.svg',
|
||||
src: '/logo-512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/svg+xml'
|
||||
type: 'image/png',
|
||||
purpose: 'any'
|
||||
},
|
||||
{
|
||||
src: 'icon.svg',
|
||||
src: '/logo-maskable-512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable'
|
||||
type: 'image/png',
|
||||
purpose: 'maskable'
|
||||
},
|
||||
{
|
||||
src: '/logo-192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
purpose: 'maskable'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user