← Back to Command Library

React

React App Setup with Vite

Create React app with Vite and run production-ready build workflow.

Modern React setup with fast local dev and optimized build.

Version

React 18+, Vite 5+

Tags

react,vite,frontend,npm

Views

4

Problem

Slow tooling and wrong starter setup reduce productivity.

Solution Summary

Vite provides fast dev server and clean build output.

Step 1

npm create vite@latest my-react-app -- --template react
Note: Create React app from Vite template.

Step 2

cd my-react-app
Note: Move into project directory.

Step 3

npm install
Note: Install all dependencies.

Step 4

npm run dev
Note: Start local dev server.

Step 5

npm run build
Note: Generate production build.

Step 6

npm run preview
Note: Preview built app locally.