Files
bakery-ia/frontend/vite.config.ts
Claude a1d2e13bc9 revert: Remove debugging infrastructure while keeping bug fixes
Removed:
- ErrorBoundary component and all error boundary wrapping
- Debug console.log statements from useReasoningTranslation
- Debug useEffect in DashboardPage
- Dev mode Dockerfile (Dockerfile.kubernetes.dev)
- Dev mode Tilt configuration
- Enhanced vite watcher config (depth, awaitWriteFinish, HMR overlay)

Kept actual bug fixes:
- String() coercion in translation functions
- useMemo/useCallback for formatters
- Null guards in components
- Basic vite ignored patterns (node_modules, dist, .git)
- Conditional rendering in DashboardPage
2025-11-07 21:23:06 +00:00

63 lines
2.0 KiB
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [
react(),
// PWA plugin temporarily disabled to avoid service worker conflicts
// VitePWA can be re-enabled later for production PWA features
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@stores': path.resolve(__dirname, './src/stores'),
'@services': path.resolve(__dirname, './src/services'),
'@utils': path.resolve(__dirname, './src/utils'),
'@types': path.resolve(__dirname, './src/types'),
},
},
server: {
host: '0.0.0.0', // Important for Docker
port: 3000,
watch: {
// Use polling for Docker/Kubernetes compatibility
usePolling: true,
ignored: [
'**/node_modules/**',
'**/dist/**',
'**/.git/**',
],
},
proxy: {
'/api': {
target: process.env.VITE_API_URL !== undefined
? (process.env.VITE_API_URL || '') // Use value or empty string
: (process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
? 'http://gateway-service:8000' // Kubernetes internal service
: 'http://localhost:8000'), // Local development
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
external: ['/runtime-config.js'], // Externalize runtime config to avoid bundling
output: {
manualChunks: {
vendor: ['react', 'react-dom', 'react-router-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu'],
charts: ['recharts'],
forms: ['react-hook-form', 'zod'],
},
},
},
},
});