Skip to content

react-vite

Use when building React SPAs with Vite — project setup, routing, bundling, or development server configuration. Also use when a project needs React without Next.js server-side features, or when building dashboards, admin panels, or embedded apps.

ModelSource
sonnetpack: frontend
Full Reference

┏━ 🔧 react-vite ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when building React SPAs with Vite — proje… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Vite (v7.x, 2026) + React 19.x. Pairs with React Router v7 and Vitest — all sharing one config. Node.js 20.19+ required.

ItemValue
React Routerv7 — import from react-router (no -dom suffix)
Vitest4.x — shares vite.config.ts
Node.js20.19+ or 22.12+
Docshttps://vite.dev/guide
TopicFileWhen to use
Project creation, vite.config.ts, tsconfig, path aliases, structurereference/setup.mdStarting a project or configuring aliases
React Router v7, layouts, loaders, protected routes, lazy loadingreference/routing.mdSetting up or extending routing
vite build, code splitting, manual chunks, assets, rolldownreference/build.mdOptimizing bundles or configuring the build
VITE_ prefix, file priority, Zod validation, TypeScript typesreference/env.mdWorking with environment variables
Dev proxy, production API config, apiFetch utilityreference/api-proxy.mdConnecting frontend to a backend
Tailwind v4, CSS Modules, styled-componentsreference/styling.mdChoosing or configuring a styling approach
Vitest setup, component tests, MSW, router testingreference/testing.mdWriting or debugging tests
Vercel, Netlify, Nginx, Docker, base URL, vs Next.jsreference/deployment.mdDeploying or choosing between Vite and Next.js

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.