fervor [>]CODING & CURIOSITY
FERVOR LEARNING SYSTEMTUTORIALS
← React

React / 2 MIN READ

Create React Vite

The way I do it

From the original Fervor library. Examples may use older package versions.

Creating a React App with Vite

Introduction

Welcome to FrOnt3nd Tutorials! In this tutorial, we’ll guide you through the process of creating and running a React app using Vite. Vite is a build tool that offers fast and efficient development experience for building modern web applications.

Install Node.js

Before you start, make sure you have Node.js installed. If not, you can download and install it from the official website: Node.js Download

Install Vite

Vite can be installed globally or locally in your project. In this tutorial, we’ll install Vite locally.

  1. Open the terminal and navigate to the directory where you want to create your Vite app.
  2. Run the following command to create a new Vite app named “my-vite-app”:
    npm init vite@latest my-vite-app -- --template react
    
    This command will create a new directory named “my-vite-app” with the React template.

Create a New React App

  1. Open the terminal and navigate to the “my-vite-app” directory that was created in the previous step.
  2. Run the following command to install dependencies:
    npm install
    
    This will install the required dependencies for your Vite app.

Run Your Vite App

  1. In the terminal, navigate to the “my-vite-app” directory.
  2. Run the following command to start a development server:
    npm run dev
    
    This command will start a development server and open your Vite app in a new browser window.

Get Live Feedback

Vite provides built-in hot module replacement (HMR) for fast updates. As you make changes to your code, Vite will automatically update the app without requiring a full reload.

Conclusion

Congratulations! You’ve successfully learned how to create and run a React app using Vite. Vite’s fast development experience and built-in features make it a powerful tool for modern web development.

For more advanced topics and in-depth learning, refer to Vite’s official documentation and other resources.

Keep your curiosity going.Explore more React →
287 TUTORIALS · 22 TOPICSREADY