- Remove references to non-existent PNG icon files in manifest - Use SVG icon for both 'any' and 'maskable' purposes - Add start_url and scope to manifest for proper PWA installation - Remove orientation restriction for better compatibility - Remove shortcuts that reference non-existent routes - Update vite.config.ts with proper PWA settings - Add devOptions to disable PWA in development - Separate 'any' and 'maskable' icon entries as required by spec - Increase container top padding to prevent hover clipping Build success: 44 entries precached (82.02 MB) Co-authored-by: Cursor <cursoragent@cursor.com>
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['assets/images/app-icon.svg', 'assets/fonts/*.otf'],
|
|
devOptions: {
|
|
enabled: false
|
|
},
|
|
manifest: {
|
|
name: 'IndeedHub - Decentralized Media Streaming',
|
|
short_name: 'IndeedHub',
|
|
description: 'Stream films and content on the decentralized web powered by Nostr and Bitcoin',
|
|
theme_color: '#0a0a0a',
|
|
background_color: '#0a0a0a',
|
|
display: 'standalone',
|
|
start_url: '/',
|
|
scope: '/',
|
|
icons: [
|
|
{
|
|
src: '/assets/images/app-icon.svg',
|
|
sizes: '512x512',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/assets/images/app-icon.svg',
|
|
sizes: '512x512',
|
|
type: 'image/svg+xml',
|
|
purpose: 'maskable'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MB limit
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,jpg,jpeg,woff,woff2,otf}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/images\.unsplash\.com\/.*/i,
|
|
handler: 'CacheFirst',
|
|
options: {
|
|
cacheName: 'unsplash-images-cache',
|
|
expiration: {
|
|
maxEntries: 50,
|
|
maxAgeSeconds: 60 * 60 * 24 * 30 // 30 days
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
host: true
|
|
}
|
|
})
|