🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@vitejs/plugin-react

Package Overview
Dependencies
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react

The default Vite plugin for React projects

4.4.1
Source
npm
Version published
Weekly downloads
9M
3.63%
Maintainers
4
Weekly downloads
 
Created

What is @vitejs/plugin-react?

The @vitejs/plugin-react package is a plugin for Vite that enables React fast refresh and other React-specific optimizations in a Vite project. It provides out-of-the-box configuration for a seamless development experience when working with React and Vite.

What are @vitejs/plugin-react's main functionalities?

Fast Refresh

Enables React Fast Refresh, which allows you to get instant feedback for changes in your React components during development without losing component state.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh()],
};

JSX Transform

Automatically transforms JSX without the need for importing React in every file, thanks to the new JSX transform introduced in React 17.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh()],
};

Custom Babel Configuration

Allows for custom Babel configurations to be used alongside the plugin, enabling advanced use cases and compatibility with additional Babel plugins.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh({ babel: { plugins: ['@babel/plugin-syntax-dynamic-import'] } })],
};

Other packages similar to @vitejs/plugin-react

Keywords

vite

FAQs

Package last updated on 19 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts