vite-plugin-swc-react-refresh
Advanced tools
+5
-9
@@ -61,3 +61,3 @@ "use strict"; | ||
| ], | ||
| async transform(code, id) { | ||
| async transform(code, id, transformOptions) { | ||
| if (id.includes("node_modules")) | ||
@@ -80,3 +80,3 @@ return; | ||
| react: { | ||
| refresh: true, | ||
| refresh: !(transformOptions == null ? void 0 : transformOptions.ssr), | ||
| development: true, | ||
@@ -109,12 +109,8 @@ useBuiltins: true, | ||
| if (result.code.includes("$RefreshReg$")) { | ||
| mappingPrefix += ";;;;;;;;;;;;"; | ||
| mappingPrefix += ";;;;;;;;"; | ||
| result.code = `import * as RefreshRuntime from "${runtimePublicPath}"; | ||
| let prevRefreshReg; | ||
| let prevRefreshSig; | ||
| if (!window.$RefreshReg$) throw new Error("React refresh preamble was not loaded. Something is wrong."); | ||
| prevRefreshReg = window.$RefreshReg$; | ||
| prevRefreshSig = window.$RefreshSig$; | ||
| const prevRefreshReg = window.$RefreshReg$; | ||
| const prevRefreshSig = window.$RefreshSig$; | ||
| window.$RefreshReg$ = RefreshRuntime.getRefreshReg("${id}"); | ||
@@ -121,0 +117,0 @@ window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; |
+1
-1
| { | ||
| "name": "vite-plugin-swc-react-refresh", | ||
| "description": "Use the versatility of SWC for development and the maturity of esbuild for production", | ||
| "version": "2.2.0", | ||
| "version": "2.2.1", | ||
| "author": "Arnaud Barré (https://github.com/ArnaudBarre)", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
25276
0.15%598
-0.33%