import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import VueDevTools from 'vite-plugin-vue-devtools' import { VitePWA } from 'vite-plugin-pwa' import tailwindcss from '@tailwindcss/vite' import path from 'path' // https://vite.dev/config/ export default defineConfig({ plugins: [ vue(), tailwindcss(), VueDevTools(), VitePWA({ registerType: 'autoUpdate', includeAssets: ['icon-192.png', 'icon-512.png', 'icon-1024.png', 'favicon.ico'], manifest: { name: 'SIBU - Sistema de Transporte', short_name: 'SIBU', description: 'Sistema de Transporte Público', theme_color: '#fee715', background_color: '#ffffff', display: 'standalone', orientation: 'portrait', scope: '/', start_url: '/', icons: [ { src: 'icon-192.png', sizes: '192x192', type: 'image/png', }, { src: 'icon-512.png', sizes: '512x512', type: 'image/png', }, { src: 'icon-1024.png', sizes: '1024x1024', type: 'image/png', }, ], }, workbox: { globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'], runtimeCaching: [ { urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i, handler: 'CacheFirst', options: { cacheName: 'google-fonts-cache', expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year }, cacheableResponse: { statuses: [0, 200], }, }, }, { urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i, handler: 'CacheFirst', options: { cacheName: 'gstatic-fonts-cache', expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year }, cacheableResponse: { statuses: [0, 200], }, }, }, ], }, devOptions: { enabled: false, type: 'module', }, }), ], resolve: { alias: { '@': path.resolve(__dirname, './src'), }, }, })