mirror of
https://github.com/nprasad2077/medicare_enrollment_dashboard.git
synced 2026-11-04 13:33:03 +00:00
64 lines
2.0 KiB
JavaScript
64 lines
2.0 KiB
JavaScript
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',
|
|
manifest: {
|
|
name: 'Medicare Enrollment Dashboard',
|
|
short_name: 'Medicare Dashboard',
|
|
description: 'Interactive analytics for CMS Medicare Monthly Enrollment data',
|
|
theme_color: '#1e3a5f',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
start_url: '/',
|
|
icons: [
|
|
{ src: '/medical-history-doctor-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: '/medical-history-doctor-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' }
|
|
]
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,png,svg,webmanifest}'],
|
|
navigateFallback: '/index.html',
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/data\.cms\.gov\/.*/i,
|
|
handler: 'NetworkFirst',
|
|
options: { cacheName: 'cms-api', expiration: { maxEntries: 50, maxAgeSeconds: 3600 } }
|
|
},
|
|
{
|
|
urlPattern: /^https:\/\/.*basemaps\.cartocdn\.com\/.*/i,
|
|
handler: 'CacheFirst',
|
|
options: { cacheName: 'map-tiles', expiration: { maxEntries: 200, maxAgeSeconds: 86400 * 30 } }
|
|
}
|
|
]
|
|
}
|
|
})
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/recharts') || id.includes('node_modules/d3-')) {
|
|
return 'vendor-charts'
|
|
}
|
|
if (id.includes('node_modules/leaflet') || id.includes('node_modules/react-leaflet')) {
|
|
return 'vendor-maps'
|
|
}
|
|
if (id.includes('node_modules/@tanstack')) {
|
|
return 'vendor-query'
|
|
}
|
|
if (id.includes('node_modules/lucide-react')) {
|
|
return 'vendor-icons'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|