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', injectRegister: 'auto', includeAssets: ['icons/*.png', 'assets/fonts/*.otf'], devOptions: { enabled: false }, manifest: false, // Use public/manifest.json instead 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 } })