- Install and configure vite-plugin-pwa - Add manifest configuration for MiChangarrito - Create SVG icons (192x192, 512x512) with MCH branding - Add apple-touch-icon and favicon - Update index.html with PWA meta tags - Enable service worker with workbox for offline caching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.svg', 'robots.txt', 'apple-touch-icon.svg'],
|
|
manifest: {
|
|
name: 'MiChangarrito',
|
|
short_name: 'Changarrito',
|
|
description: 'Sistema POS para changarritos',
|
|
theme_color: '#f97316',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
icons: [
|
|
{
|
|
src: 'pwa-192x192.svg',
|
|
sizes: '192x192',
|
|
type: 'image/svg+xml'
|
|
},
|
|
{
|
|
src: 'pwa-512x512.svg',
|
|
sizes: '512x512',
|
|
type: 'image/svg+xml'
|
|
},
|
|
{
|
|
src: 'pwa-512x512.svg',
|
|
sizes: '512x512',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any maskable'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}']
|
|
}
|
|
})
|
|
],
|
|
server: {
|
|
port: 3140,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3141',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
})
|