@vitejs/plugin-react-swc
Advanced tools
Comparing version 3.3.2 to 3.4.0
@@ -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; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
33383
871
92
5
Updated@swc/core@^1.3.85