Frontend features: - My Trees personal dashboard with fork tracking (Issue #15) - Tree sharing UI with token generation and copy (Issue #16) - Draft tree badges and validation UI (Issue #25) - Save session as tree modal (Issue #17) - Rate/review modal with localStorage tracking (Issue #19) - Admin category management with drag-and-drop (Issue #18) - Bundle size optimization with code splitting (Issue #31) Components created: - MyTreesPage: Personal tree organization - AdminCategoriesPage: Category CRUD with @dnd-kit - ShareTreeModal: Tree sharing interface - SaveSessionAsTreeModal: Session conversion UI - StepRatingModal: Post-session rating with stars - StarRating: Reusable rating component - PageLoader: Loading fallback for lazy routes - CreateCategoryModal, EditCategoryModal: Admin modals Bundle optimization: - Reduced from 892 KB to 221 KB (75% reduction) - Dynamic imports for 9 heavy pages - Vendor chunk splitting for optimal caching - 6 separate vendor chunks (react, markdown, utils, dnd, icons, state) Dependencies added: - @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities API clients: - stepCategories: Full CRUD for admin - Enhanced sessions: saveAsTree endpoint - Enhanced trees: share, fork, canPublish endpoints Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// React core and routing
|
|
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
|
// Markdown rendering
|
|
'markdown-vendor': ['react-markdown'],
|
|
// State management
|
|
'state-vendor': ['zustand', 'immer', 'zundo'],
|
|
// Icons
|
|
'icons-vendor': ['lucide-react'],
|
|
// Utilities and UI libs
|
|
'utils-vendor': [
|
|
'axios',
|
|
'clsx',
|
|
'tailwind-merge',
|
|
'class-variance-authority',
|
|
'date-fns',
|
|
'sonner',
|
|
],
|
|
// Drag and drop
|
|
'dnd-vendor': [
|
|
'@dnd-kit/core',
|
|
'@dnd-kit/sortable',
|
|
'@dnd-kit/utilities',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 500,
|
|
},
|
|
})
|