Proje: Okul.com.tr CRM · Hub: Okul.com.tr CRM — Architecture

CRM Build Optimizasyonu

Vite Konfigürasyonu (vite.config.ts)

  • Dev server: port 3000, auto-open
  • @ alias → ./src
  • Heavy deps pre-bundle: lucide-react, jodit-react (cold start hızlandırır)
  • Build: esbuild minify, source map yok

Manuel Chunk Splitting

Chunk AdıİçerikNeden Ayrı
vendor-iconslucide-reactBüyük, sık değişmez → cache kazancı
vendor-ui@radix-ui/*UI primitifler birlikte yüklenir
vendor-formsreact-hook-form, zodForm sayfaları için lazy
vendor-editorsjodit, @tiptap/*En ağır — sadece edit sayfalarında gerekli
vendor-httpaxiosHTTP client
vendor-statezustandState management
vendor-reactreact-dom, react-routerReact core

Lazy Loading

src/App.tsx veya routing dosyasında React.lazy() ile route-based code splitting yapılmış olmalı.

Bundle Analizi

npm run build:analyze   # dist/bundle-analysis.html oluşturur
npm run bundle-size     # bundlesize check

Package.json Scripts

npm run dev             # Vite dev server (port 3000)
npm run build           # Production build
npm run build:staging   # Staging build
npm run build:production # Production + optimizations
npm run test            # Vitest watch mode
npm run test:run        # Vitest once
npm run test:coverage   # Coverage report