React
Vite Commands
Use Vite for lightning-fast React development. Near-instant dev server startup, HMR that stays fast regardless of app size, and optimized production builds.
11 commands
Pro Tips
Create a new project: 'npm create vite@latest my-app -- --template react-ts' for React + TypeScript.
Use 'vite preview' to locally preview the production build before deploying.
Configure path aliases in vite.config.ts: 'resolve: { alias: { "@": path.resolve(__dirname, "./src") } }'.
Common Mistakes
Vite uses ESM in development but bundles for production. Some libraries behave differently — test both modes.
Environment variables must be prefixed with VITE_ to be exposed to client code. Others are server-only.