Spaces:
Paused
Paused
| import { defineConfig } from "vite"; | |
| import react from "@vitejs/plugin-react"; | |
| import path from "path"; | |
| import { componentTagger } from "lovable-tagger"; | |
| import { VitePWA } from "vite-plugin-pwa"; | |
| // https://vitejs.dev/config/ | |
| export default defineConfig(({ mode }) => ({ | |
| server: { | |
| host: "::", | |
| port: 8888, | |
| proxy: { | |
| '/api': { | |
| target: 'http://localhost:3001', | |
| changeOrigin: true, | |
| secure: false, | |
| }, | |
| '/health': { | |
| target: 'http://localhost:3001', | |
| changeOrigin: true, | |
| secure: false, | |
| }, | |
| '/mcp': { | |
| target: 'http://localhost:3001', | |
| changeOrigin: true, | |
| secure: false, | |
| ws: true | |
| } | |
| } | |
| }, | |
| plugins: [ | |
| react(), | |
| mode === "development" && componentTagger(), | |
| VitePWA({ | |
| registerType: "autoUpdate", | |
| includeAssets: ["favicon.ico", "icon-192.png", "icon-512.png"], | |
| manifest: { | |
| name: "Cyber Security Dashboard", | |
| short_name: "CyberDash", | |
| description: "Real-time cybersecurity threat intelligence and monitoring dashboard", | |
| theme_color: "#00d4ff", | |
| background_color: "#0a0a0f", | |
| display: "standalone", | |
| orientation: "any", | |
| start_url: "/", | |
| icons: [ | |
| { | |
| src: "/icon-192.png", | |
| sizes: "192x192", | |
| type: "image/png", | |
| purpose: "any maskable", | |
| }, | |
| { | |
| src: "/icon-512.png", | |
| sizes: "512x512", | |
| type: "image/png", | |
| purpose: "any maskable", | |
| }, | |
| ], | |
| }, | |
| workbox: { | |
| maximumFileSizeToCacheInBytes: 5000000, | |
| 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, | |
| }, | |
| }, | |
| }, | |
| ], | |
| }, | |
| }), | |
| ].filter(Boolean), | |
| resolve: { | |
| alias: { | |
| "@": path.resolve(__dirname, "./src"), | |
| }, | |
| }, | |
| build: { | |
| rollupOptions: { | |
| output: { | |
| manualChunks: { | |
| vendor: ['react', 'react-dom', 'react-router-dom'], | |
| ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu', 'lucide-react'], | |
| charts: ['recharts'], | |
| }, | |
| }, | |
| }, | |
| }, | |
| })); | |