- Added SimpleBrowserProcessor class to handle student requests in a queue. - Introduced methods for adding requests, notifying subscribers, and processing the queue. - Mock AI matching logic implemented to simulate resource matching based on request categories and urgency. - Added generateInsights method to analyze request trends and urgencies. feat: Create authentication context for user management - Developed AuthContext to manage user authentication state. - Implemented login and logout functionalities with mock user data. - Added loading state management during authentication processes. feat: Add notification context for managing user notifications - Created NotificationContext to handle notifications throughout the application. - Implemented methods for adding, marking as read, and removing notifications. feat: Introduce common hooks for utility functions - Developed useHashRoute for hash-based routing. - Created useLocalStorage for managing local storage with TypeScript support. - Implemented useMediaQuery for responsive design handling. - Added useDebounce for debouncing values in state. feat: Implement donation impact calculation hook - Created useDonationImpact hook to calculate the impact of donations. - Added useFormValidation hook for form state management and validation. feat: Design main layout and page structure components - Developed MainLayout and PageShell components for consistent layout structure. - Created SectionHeader and Card components for reusable UI elements. feat: Build HomePage with impact statistics and service offerings - Implemented HomePage component with hero section, impact stats, and service cards. - Integrated tracking for donation and volunteer actions. feat: Add analytics utilities for tracking events - Created analytics utility for tracking page views and custom events. - Implemented donation and volunteer tracking functionalities. feat: Enhance helper functions for various utilities - Developed utility functions for impact calculation, formatting, validation, and debouncing.
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { resolve } from 'path'
|
|
|
|
// Optimized Vite Configuration for Production
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
open: true,
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// Core React libraries
|
|
vendor: ['react', 'react-dom'],
|
|
|
|
// UI and animations
|
|
ui: ['framer-motion', 'lucide-react'],
|
|
|
|
// AI libraries (browser-compatible)
|
|
ai: ['@tensorflow/tfjs'],
|
|
|
|
// Utilities
|
|
utils: ['date-fns', 'react-helmet-async']
|
|
},
|
|
chunkFileNames: 'js/[name]-[hash].js'
|
|
}
|
|
},
|
|
// Enable compression
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
// Optimize chunks
|
|
chunkSizeWarningLimit: 500,
|
|
},
|
|
}) |