@vitejs/plugin-react
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -154,8 +154,8 @@ var __create = Object.create; | ||
visitor: { | ||
CallExpression(path) { | ||
const node = getJSXNode(path.node); | ||
CallExpression(path2) { | ||
const node = getJSXNode(path2.node); | ||
if (node == null) { | ||
return null; | ||
} | ||
path.replaceWith(node); | ||
path2.replaceWith(node); | ||
} | ||
@@ -183,4 +183,6 @@ } | ||
var import_fs = __toESM(require("fs")); | ||
var import_path = __toESM(require("path")); | ||
var runtimePublicPath = "/@react-refresh"; | ||
var runtimeFilePath = require.resolve("react-refresh/cjs/react-refresh-runtime.development.js"); | ||
var reactRefreshDir = import_path.default.dirname(require.resolve("react-refresh/package.json")); | ||
var runtimeFilePath = import_path.default.join(reactRefreshDir, "cjs/react-refresh-runtime.development.js"); | ||
var runtimeCode = ` | ||
@@ -273,6 +275,6 @@ const exports = {} | ||
visitor: { | ||
ImportDeclaration(path) { | ||
const decl = path.node; | ||
ImportDeclaration(path2) { | ||
const decl = path2.node; | ||
const spec = decl.specifiers[0]; | ||
path.replaceWith(t.variableDeclaration("var", [ | ||
path2.replaceWith(t.variableDeclaration("var", [ | ||
t.variableDeclarator(spec.local, t.memberExpression(t.callExpression(t.identifier("require"), [decl.source]), spec.imported)) | ||
@@ -394,3 +396,3 @@ ])); | ||
plugins.push([ | ||
await loadPlugin("react-refresh/babel.js"), | ||
await loadPlugin("react-refresh/babel"), | ||
{ skipEnvCheck: true } | ||
@@ -536,4 +538,4 @@ ]); | ||
viteReact.preambleCode = preambleCode; | ||
function loadPlugin(path) { | ||
return Promise.resolve().then(() => __toESM(require(path))).then((module2) => module2.default || module2); | ||
function loadPlugin(path2) { | ||
return Promise.resolve().then(() => __toESM(require(path2))).then((module2) => module2.default || module2); | ||
} | ||
@@ -540,0 +542,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "@vitejs/plugin-react", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"license": "MIT", | ||
@@ -36,3 +36,3 @@ "author": "Evan You", | ||
"dependencies": { | ||
"@babel/core": "^7.17.8", | ||
"@babel/core": "^7.17.9", | ||
"@babel/plugin-transform-react-jsx": "^7.17.3", | ||
@@ -43,5 +43,5 @@ "@babel/plugin-transform-react-jsx-development": "^7.16.7", | ||
"@rollup/pluginutils": "^4.2.0", | ||
"react-refresh": "^0.11.0", | ||
"react-refresh": "^0.12.0", | ||
"resolve": "^1.22.0" | ||
} | ||
} |
@@ -78,3 +78,3 @@ # @vitejs/plugin-react [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react.svg)](https://npmjs.com/package/@vitejs/plugin-react) | ||
This option does not enable _code transformation_. That is handled by ESBuild. | ||
This option does not enable _code transformation_. That is handled by esbuild. | ||
@@ -81,0 +81,0 @@ **Note:** TypeScript syntax is handled automatically. |
import type { types as t } from '@babel/core' | ||
import fs from 'fs' | ||
import path from 'path' | ||
export const runtimePublicPath = '/@react-refresh' | ||
const runtimeFilePath = require.resolve( | ||
'react-refresh/cjs/react-refresh-runtime.development.js' | ||
const reactRefreshDir = path.dirname( | ||
require.resolve('react-refresh/package.json') | ||
) | ||
const runtimeFilePath = path.join( | ||
reactRefreshDir, | ||
'cjs/react-refresh-runtime.development.js' | ||
) | ||
@@ -10,0 +15,0 @@ export const runtimeCode = ` |
@@ -179,3 +179,3 @@ import type { ParserOptions, TransformOptions, types as t } from '@babel/core' | ||
plugins.push([ | ||
await loadPlugin('react-refresh/babel.js'), | ||
await loadPlugin('react-refresh/babel'), | ||
{ skipEnvCheck: true } | ||
@@ -182,0 +182,0 @@ ]) |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
55995
1441
0
+ Addedreact-refresh@0.12.0(transitive)
- Removedreact-refresh@0.11.0(transitive)
Updated@babel/core@^7.17.9
Updatedreact-refresh@^0.12.0