mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
Phase 0: Remove ~920 lines of dead code (ThemeBentoPicker, PromoDiscountBadge, AdminLayout, SettingsSidebar, MovingGradient, EmptyState, miniapp API, unused types/functions/transitions/skeleton helpers). Fix API barrel file (add 20 missing exports). Phase 1: Add ErrorBoundary (app/page/widget levels), centralize constants, add axios timeout, fix staleTime:0 in React Query. Phase 2: Consolidate hexToHsl, extract email validation, fix duplicate code. Phase 3: Fix auth race condition (await checkAdminStatus), memoize useCurrency, add WebSocket message validation. Phase 4: Extract useBranding, useFeatureFlags, useScrollRestoration from AppShell. Phase 5: Remove all eslint-disable react-hooks/exhaustive-deps (14 total), simplify logger, remove deprecated hooks (useBackButton, useTelegramDnd, useTelegramWebApp). Dependencies: React 19, react-router 7, zustand 5, i18next 25, react-i18next 16, eslint-plugin-react-refresh 0.5. Remove unused @lottiefiles/dotlottie-react. Convert vite manualChunks to function-based approach for react-router v7 compat. Lint: Fix logger.ts no-unused-expressions, fix react-refresh/only-export-components in 6 Radix primitive files (const re-exports → direct re-exports), fix WebSocketProvider exhaustive-deps. Result: 0 errors, 0 warnings. Add CLAUDE.md to .gitignore.
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
// Base path - use '/' for standalone Docker deployment
|
|
// Change to '/cabinet/' if serving from a sub-path
|
|
base: '/',
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
// Strip /api prefix: /api/cabinet/auth -> /cabinet/auth
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: false,
|
|
chunkSizeWarningLimit: 550,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (!id.includes('node_modules')) return;
|
|
if (
|
|
id.includes('react-dom') ||
|
|
id.includes('react-router') ||
|
|
id.includes('node_modules/react/')
|
|
)
|
|
return 'vendor-react';
|
|
if (id.includes('@tanstack/react-query')) return 'vendor-query';
|
|
if (id.includes('i18next') || id.includes('react-i18next')) return 'vendor-i18n';
|
|
if (id.includes('framer-motion')) return 'vendor-motion';
|
|
if (id.includes('@radix-ui/')) return 'vendor-radix';
|
|
if (id.includes('@dnd-kit/')) return 'vendor-dnd';
|
|
if (id.includes('@telegram-apps/')) return 'vendor-telegram';
|
|
if (id.includes('/ogl/')) return 'vendor-webgl';
|
|
if (id.includes('/cmdk/')) return 'vendor-cmdk';
|
|
if (
|
|
id.includes('/axios/') ||
|
|
id.includes('/zustand/') ||
|
|
id.includes('/clsx/') ||
|
|
id.includes('/tailwind-merge/') ||
|
|
id.includes('class-variance-authority') ||
|
|
id.includes('/dompurify/')
|
|
)
|
|
return 'vendor-utils';
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|