Socket
Socket
Sign inDemoInstall

@vitejs/plugin-react-swc

Package Overview
Dependencies
Maintainers
5
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react-swc - npm Package Compare versions

Comparing version 3.3.2 to 3.4.0

7

index.d.ts

@@ -0,1 +1,2 @@

import { JscTarget } from "@swc/core";
import { PluginOption } from "vite";

@@ -18,4 +19,10 @@ type Options = {

plugins?: [string, Record<string, any>][];
/**
* Set the target for SWC in dev. This can avoid to down-transpile private class method for example.
* For production target, see https://vitejs.dev/config/build-options.html#build-target
* @default "es2020"
*/
devTarget?: JscTarget;
};
declare const react: (_options?: Options) => PluginOption[];
export default react;

4

package.json
{
"name": "@vitejs/plugin-react-swc",
"description": "Speed up your Vite dev server with SWC",
"version": "3.3.2",
"version": "3.4.0",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",

@@ -31,4 +31,4 @@ "license": "MIT",

"dependencies": {
"@swc/core": "^1.3.61"
"@swc/core": "^1.3.85"
}
}

@@ -43,2 +43,4 @@ # @vitejs/plugin-react-swc [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react-swc)](https://www.npmjs.com/package/@vitejs/plugin-react-swc)

`@default` "react"
```ts

@@ -52,2 +54,4 @@ react({ jsxImportSource: "@emotion/react" });

`@default` false
```ts

@@ -65,2 +69,14 @@ react({ tsDecorators: true });

## devTarget
Set the target for SWC in dev. This can avoid to down-transpile private class method for example.
For production target, see https://vitejs.dev/config/build-options.html#build-target.
`@default` "es2020"
```ts
react({ devTarget: "es2022" });
```
## Consistent components exports

@@ -67,0 +83,0 @@

@@ -394,5 +394,8 @@ /*! Copyright (c) Meta Platforms, Inc. and affiliates. **/

function validateRefreshBoundaryAndEnqueueUpdate(prevExports, nextExports) {
if (!predicateOnExport(prevExports, (key) => !!nextExports[key])) {
if (!predicateOnExport(prevExports, (key) => key in nextExports)) {
return "Could not Fast Refresh (export removed)";
}
if (!predicateOnExport(nextExports, (key) => key in prevExports)) {
return "Could not Fast Refresh (new export)";
}
let hasExports = false;

@@ -405,4 +408,2 @@ const allExportsAreComponentsOrUnchanged = predicateOnExport(

return true;
if (!prevExports[key])
return false;
return prevExports[key] === nextExports[key];

@@ -409,0 +410,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc