Socket
Socket
Sign inDemoInstall

@vitejs/plugin-react

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

22

dist/index.js

@@ -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 @@ ])

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