Vite Setup Vite Project Setup
Last updated: 2026-11-02
Vite Setup Vite Project Setup
Vite is today's mainstream scaffolder for React projects: one command generates a development environment with hot reloading, and both startup and build times are far faster than the old CRA setup. Whether you are learning or shipping a new product, starting from it is the recommended path. The generated project is a plain npm package, so every tool in the ecosystem works out of the box.
| Group | Core Concepts |
|---|---|
| Kind | Tooling |
| Since | Mainstream in the React 18 / Vite 5 era |
ℹ️ Info The editor transpiles JSX to JavaScript and renders the real UI in a sandbox; components mount automatically — no manual render call needed.
📝 Syntax
npm create vite@latest my-app -- --template react
cd my-app
npm install
npm run dev # Starts the dev server on http://localhost:5173
⚙️ Parameters
| --template react | Selects the React (JavaScript) template; use react-ts for a TypeScript project. |
|---|
Returns:No return value — this is a scaffolding tool: what it produces is a local project directory and a set of npm scripts.
▶ Example
The example runs out of the box: it auto-renders when expanded, and edits take effect instantly.
Output:
A monospace card lists four lines of "file name — description"; clicking any line highlights it, and the bottom line shows "Currently selected: xxx", mimicking how you browse the directory of a Vite project and what each file is responsible for.