DEV Community

TenE
TenE

Posted on

2

Setting Up a React Project with Vite

Why Set Up a React Project?

React needs a build tool to manage dependencies, compile JSX, and optimize performance. The two most popular ways to set up a React project are:

  1. Create React App (CRA) – Official but slower and its now Sunset
  2. Vite – Faster, modern alternative

Setting Up React with Vite

Vite is a modern build tool that offers:

  • Faster development server.
  • Better performance with ES modules.
  • Optimized production build.

Steps to Create a React App with Vite

1. Open Terminal & Run:

npm create vite@latest my-app --template react
Enter fullscreen mode Exit fullscreen mode

or using Yarn:

yarn create vite@latest my-app --template react
Enter fullscreen mode Exit fullscreen mode

or using pnpm:

pnpm create vite@latest my-app --template react
Enter fullscreen mode Exit fullscreen mode

2. Navigate to the project folder:

cd my-app
Enter fullscreen mode Exit fullscreen mode

3. Install dependencies:

npm install
Enter fullscreen mode Exit fullscreen mode

4. Start the development server:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Vite For

Feature Vite 🚀 CRA 🐢
Startup Speed ⚡ Instant 🐌 Slow
Build Speed 🔥 Fast 🚶‍♂️ Moderate
Uses Webpack? ❌ No (ES Modules) ✅ Yes
Production Build ✅ Optimized ⚠️ Heavier
Plugins Support ✅ Excellent (Rollup-based) ✅ Good (Webpack-based)

ACI image

ACI.dev: The Only MCP Server Your AI Agents Need

ACI.dev’s open-source tool-use platform and Unified MCP Server turns 600+ functions into two simple MCP tools on one server—search and execute. Comes with multi-tenant auth and natural-language permission scopes. 100% open-source under Apache 2.0.

Star our GitHub!

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Embark on this engaging article, highly regarded by the DEV Community. Whether you're a newcomer or a seasoned pro, your contributions help us grow together.

A heartfelt "thank you" can make someone’s day—drop your kudos below!

On DEV, sharing insights ignites innovation and strengthens our bonds. If this post resonated with you, a quick note of appreciation goes a long way.

Get Started