diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..71a3d22 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,39 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import tailwindcss from '@tailwindcss/vite' +import { VitePWA } from 'vite-plugin-pwa' + +export default defineConfig({ + plugins: [ + react(), + tailwindcss(), + VitePWA({ + registerType: 'autoUpdate', + includeAssets: ['favicon.svg', 'og-image.jpg'], + manifest: { + name: 'CQRC Platform', + short_name: 'CQRC', + description: 'Generate beautiful, customizable QR codes instantly', + theme_color: '#7C6FE0', + background_color: '#ffffff', + display: 'standalone', + icons: [ + { src: '/favicon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any maskable' } + ] + }, + workbox: { + globPatterns: ['**/*.{js,css,html,svg,png,jpg,webp}'], + runtimeCaching: [ + { + urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i, + handler: 'CacheFirst', + options: { cacheName: 'google-fonts', expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 365 } } + } + ] + } + }) + ], + server: { + allowedHosts: true, + }, +})