/vitejs

Primary LanguageJavaScript

Vite.js with React

Introduction

Vite.js is a fast build tool that significantly improves the frontend development experience. This guide will help you set up a new Vite.js project with React, allowing you to quickly start building modern web applications.

Getting Started

To create a new Vite.js project with React, follow these steps:

  1. Run the following command, replacing vitejs with your desired project name:

    npm create vite@4.1.0 vitejs
  2. Choose React as your framework when prompted.

  3. Select JavaScript as the variant.

  4. Once the project is created, navigate into the project directory:

    cd vitejs

Usage

After setting up the project, you can use the following commands:

  • Install Packages:

    npm install
  • Run the Project:

    npm run dev

    This will start a development server for your Vite.js project with React.

Additional Commands

You can also use the following commands:

  • Build for Production:

    npm run build

    This command builds the project for production, generating optimized assets for deployment.

  • Serve the Production Build Locally:

    npm run serve

    After building the project for production, this command serves the optimized build locally, allowing you to preview the production version of your application.

Learn More

For more information about Vite.js and its capabilities, visit the official documentation.