@vitejs/plugin-react 2.0.1 → 2.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -1
- package/src/jsx-runtime/babel-restore-jsx.ts +2 -2
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitejs/plugin-react",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.1.0-beta.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Evan You",
|
6
6
|
"contributors": [
|
@@ -39,7 +39,7 @@
|
|
39
39
|
},
|
40
40
|
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-react#readme",
|
41
41
|
"dependencies": {
|
42
|
-
"@babel/core": "^7.18.
|
42
|
+
"@babel/core": "^7.18.13",
|
43
43
|
"@babel/plugin-transform-react-jsx": "^7.18.10",
|
44
44
|
"@babel/plugin-transform-react-jsx-development": "^7.18.6",
|
45
45
|
"@babel/plugin-transform-react-jsx-self": "^7.18.6",
|
package/src/index.ts
CHANGED
@@ -406,7 +406,10 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
|
|
406
406
|
config() {
|
407
407
|
return {
|
408
408
|
optimizeDeps: {
|
409
|
-
|
409
|
+
// We can't add `react-dom` because the dependency is `react-dom/client`
|
410
|
+
// for React 18 while it's `react-dom` for React 17. We'd need to detect
|
411
|
+
// what React version the user has installed.
|
412
|
+
include: [reactJsxRuntimeId, reactJsxDevRuntimeId, 'react']
|
410
413
|
}
|
411
414
|
}
|
412
415
|
},
|
@@ -76,7 +76,7 @@ export default function (
|
|
76
76
|
|
77
77
|
/**
|
78
78
|
* Get a JSXIdentifier or JSXMemberExpression from a Node of known type.
|
79
|
-
* Returns null if
|
79
|
+
* Returns null if an unknown node type, null or undefined is passed.
|
80
80
|
*/
|
81
81
|
function getJSXName(node: any): any {
|
82
82
|
if (node == null) {
|
@@ -100,7 +100,7 @@ export default function (
|
|
100
100
|
}
|
101
101
|
|
102
102
|
/**
|
103
|
-
* Get
|
103
|
+
* Get an array of JSX(Spread)Attribute from a props ObjectExpression.
|
104
104
|
* Handles the _extends Expression babel creates from SpreadElement nodes.
|
105
105
|
* Returns null if a validation error occurs.
|
106
106
|
*/
|