If you've ever felt that create-react-app takes too long to set up or runs a bit slow, you're not alone. That's where Vite comes in.
Vite (pronounced "veet") is a modern build tool that makes React development blazing fast. In this post, I'll show you how to create a React app using Vite in simple steps.
✅ Step 1: Install Node.js
Make sure you have Node.js installed on your system.
To check, run:
node -v
If you don't have it, download it from nodejs.org.
✅ Step 2: Create a Vite Project
Open your terminal and run:
npm create vite@latest my-app
Here's what happens:
-
vite@latest
→ downloads the latest Vite template -
my-app
→ this is your project folder (you can name it anything)
Vite will then ask you to select:
- Framework → Choose React
- Variant → Choose JavaScript or TypeScript (your choice)
✅ Step 3: Move Into the Project Folder
cd my-app
✅ Step 4: Install Dependencies
npm install
This downloads all the required packages.
✅ Step 5: Start the Development Server
npm run dev
🎉 That's it! Vite will start a local server and give you a link (usually http://localhost:5173
) where your React app is running.
🛠️ Bonus: Useful Tips
To build for production:
npm run build
To preview the production build locally:
npm run preview
Pro Tip: If you're using VS Code, install the ES7+ React/Redux snippets extension for faster coding.
🚀 Why Vite Over CRA?
- Faster startup → Uses native ES modules
- Hot Module Replacement (HMR) → Instant updates when you save changes
- Lightweight → No extra configs unless you need them
🎯 Conclusion
That's it! You've created a React app using Vite in just a few minutes.
No waiting for long builds, no heavy configs — just fast React development.
Now you can start building components and working on your project!
🏷️ Tags: #react
#vite
#javascript
#beginners
#tutorial
Top comments (0)