Configuration File
Location:source/frontend/vite.config.ts
Configuration Options
Plugins
TailStack configures two essential Vite plugins:Array of Vite plugins that extend build functionality
React Plugin
Official Vite plugin providing:
- Fast Refresh - Instant feedback during development without losing component state
- JSX transformation - Automatic React JSX runtime with React 19 support
- Automatic JSX runtime - No need to import React in component files
- Development optimizations - Enhanced error messages and debugging
Tailwind CSS Plugin
Official Tailwind CSS v4 Vite plugin providing:
- Native CSS integration - No PostCSS configuration required
- Lightning-fast builds - Optimized for Vite’s architecture
- CSS-first workflow - Import Tailwind directly in your CSS
- Hot module replacement - Instant style updates during development
TailStack uses Tailwind CSS v4, which has a completely different architecture than v3. The Vite plugin handles all processing without PostCSS.
Module Resolution
Configure module path aliases for cleaner imports
Path Aliases
@ alias maps to the src/ directory:
Default Vite Behavior
TailStack leverages Vite’s sensible defaults:Development Server
Development server port (Vite default)
Development server host
Exit if port is already in use (false = auto-increment)
Automatically open browser on server start
Build Configuration
Output directory for production build
Generate source maps for production
Minification method (esbuild is fastest)
Browser compatibility target (modules = modern browsers with ES modules)
Environment Variables
Vite exposes environment variables prefixed withVITE_ to your client code:
Current mode:
development, production, or customWhether app is running in development mode
Whether app is running in production mode
Base URL the app is being served from
Common Customizations
Custom Port
Proxy API Requests
Additional Path Aliases
If you add custom aliases, remember to update
tsconfig.json paths as well.Enable Source Maps
Vite Commands
Commands available via npm scripts:Development Server Features
- Hot Module Replacement (HMR) - Instant updates without full page reload
- Fast Cold Start - Leverages native ESM for quick server startup
- Optimized Dependencies - Pre-bundles dependencies with esbuild
- CSS Hot Reload - Style changes reflect instantly
Production Build Features
- Code Splitting - Automatic chunking for optimal loading
- Tree Shaking - Removes unused code
- Asset Optimization - Minification and compression
- Legacy Support - Optional polyfills with @vitejs/plugin-legacy
TypeScript Integration
Vite handles TypeScript files natively:.tsand.tsxfiles - Automatically transpiled- Type checking - Delegated to
tsc(Vite only transpiles) - Fast transpilation - Uses esbuild for lightning-fast builds
Vite does NOT type-check your code during build. Run
tsc -b separately or use vite-plugin-checker for type-checking during development.Performance Tips
- Keep dependencies optimizable - Vite pre-bundles ESM dependencies
- Use dynamic imports - Code-split large components
- Optimize images - Use appropriate formats and sizes
- Minimize plugin usage - Only add plugins you actually need
- Enable CSS code splitting - Separate CSS for each route