Socket
Socket
Sign inDemoInstall

@vitejs/plugin-react-swc

Package Overview
Dependencies
Maintainers
5
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react-swc

Speed up your Vite dev server with SWC


Version published
Weekly downloads
1.2M
increased by1.43%
Maintainers
5
Weekly downloads
 
Created

What is @vitejs/plugin-react-swc?

@vitejs/plugin-react-swc is a Vite plugin that enables the use of React with the SWC (Speedy Web Compiler) compiler. This plugin provides faster build times and improved performance for React applications by leveraging SWC's capabilities.

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

Basic Setup

This code demonstrates how to include the @vitejs/plugin-react-swc plugin in a Vite configuration file. This setup allows Vite to use SWC for compiling React code.

```json
{
  "plugins": [
    "@vitejs/plugin-react-swc"
  ]
}
```

Custom SWC Configuration

This code sample shows how to customize the SWC configuration within the Vite plugin. It configures SWC to parse TypeScript and use the automatic JSX runtime.

```json
{
  "plugins": [
    ["@vitejs/plugin-react-swc", {
      "jsc": {
        "parser": {
          "syntax": "typescript",
          "tsx": true
        },
        "transform": {
          "react": {
            "runtime": "automatic"
          }
        }
      }
    }]
  ]
}
```

Other packages similar to @vitejs/plugin-react-swc

Keywords

FAQs

Package last updated on 08 Dec 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc