Files

74 lines
2.1 KiB
JavaScript
Raw Permalink Normal View History

2025-06-11 21:12:42 -03:00
import { defineConfig } from 'vite'
2025-12-10 12:56:58 -03:00
import { VitePWA } from 'vite-plugin-pwa'
2025-06-11 21:12:42 -03:00
export default defineConfig({
2025-06-13 21:03:36 -03:00
base: '/calories-tracker/',
2025-12-10 12:56:58 -03:00
include: ['src', 'vite-end.d.ts'],
plugins: [
VitePWA({
registerType: 'prompt',
includeAssets: ['assets/*.png', 'assets/*.ico', 'assets/*.xml'],
manifest: {
name: 'Food Tracker - Daily Calorie Tracker',
short_name: 'Food Tracker',
description: 'Track your nutrition, transform your health. Monitor calories, protein, fat, carbs, and fiber for every meal.',
theme_color: '#121212',
background_color: '#121212',
display: 'standalone', // CRITICAL: Enables fullscreen
orientation: 'portrait',
scope: '/calories-tracker/',
start_url: '/calories-tracker/',
icons: [
2025-12-10 13:14:07 -03:00
{
src: '/calories-tracker/assets/apple-icon-180x180.png',
sizes: '180x180',
type: 'image/png',
purpose: 'any'
},
2025-12-10 12:56:58 -03:00
{
src: '/calories-tracker/assets/android-icon-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any maskable'
},
{
src: '/calories-tracker/assets/icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable'
}
]
},
workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
],
cleanupOutdatedCaches: true,
globPatterns: ['**/*.{js,css,html,ico,png,svg}']
},
devOptions: {
enabled: false, // Disable in dev to avoid warnings; test with preview mode
type: 'module'
}
})
]
2025-06-11 21:12:42 -03:00
})