How to use Vite build tool In React

Step 1: Navigate to the folder where you want to create the project and open it in terminal

Step 2: In the terminal of the application directory type the following command.

npm  create  vite@latest   <<Application_name>>

npm create vite@latest

Step 3: Select the React Framework and then variant as JavaScript from options.

select javascript variant

Step 4: Navigate to the newly created folder using the command.

cd <<Application_name>>

now, we can see the basic project structure show in below image.

project structure

Step 5: Use the below command in terminal to install all required dependencies.

npm install 
      OR
npm i

npm install

After successfully executing this command we can see a new folder named “node_module” in the project folder which contains all the dependencies.

node_modules

Step 6: To run the application use the following command in terminal.

npm run dev

vite+react page



React Environment Setup

To run any React application, we need to first setup a ReactJS Development Environment. In this article, we will show you a step-by-step guide to installing and configuring a working React development environment.

We will discuss the following approaches to setup environment in React.

Table of Content

  • Using create-react-app (CRA command)
  • Using webpack and babel
  • Using Vite build tool

Similar Reads

Pre-requisite:

We must have NodeJS installed on our PC. So, the very first step will be to install NodeJS. Once we have set up NodeJS on our PC, the next thing we need to do is set up React Boilerplate....

Method 1: Using create-react-app (CRA commond)

Step 1: Navigate to the folder where you want to create the project and open it in terminal...

Method 2: Using webpack and babel

To setup a react development environment using webpack and babel is a long process and we have to import each package and create setup files ourselves....

Method 3: Using Vite build tool

Step 1: Navigate to the folder where you want to create the project and open it in terminal...

Contact Us