@vitejs/plugin-react 6.0.0 → 6.0.2
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/README.md +10 -2
- package/dist/index.d.ts +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -79,10 +79,16 @@ Under the hood, this simply updates the React Fash Refresh runtime URL from `/@r
|
|
|
79
79
|
|
|
80
80
|
## React Compiler
|
|
81
81
|
|
|
82
|
-
[React Compiler](https://react.dev/learn/react-compiler) support is available via the exported `reactCompilerPreset` helper, which requires [`@rolldown/plugin-babel`](https://npmx.dev/package/@rolldown/plugin-babel) and [`babel-plugin-react-compiler`](https://npmx.dev/package/babel-plugin-react-compiler) as peer dependencies:
|
|
82
|
+
[React Compiler](https://react.dev/learn/react-compiler) support is available via the exported `reactCompilerPreset` helper, which requires [`@rolldown/plugin-babel`](https://npmx.dev/package/@rolldown/plugin-babel) and [`babel-plugin-react-compiler`](https://npmx.dev/package/babel-plugin-react-compiler) and [`@babel/core`](https://npmx.dev/package/@babel/core) as peer dependencies:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
npm install -D @rolldown/plugin-babel babel-plugin-react-compiler
|
|
85
|
+
npm install -D @rolldown/plugin-babel @babel/core babel-plugin-react-compiler
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
If you are using TypeScript, you will also need to install [`@types/babel__core`](https://npmx.dev/package/@types/babel__core):
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npm install -D @types/babel__core
|
|
86
92
|
```
|
|
87
93
|
|
|
88
94
|
```js
|
|
@@ -101,6 +107,8 @@ The `reactCompilerPreset` accepts an optional options object with the following
|
|
|
101
107
|
- `compilationMode` — Set to `'annotation'` to only compile components annotated with `"use memo"`.
|
|
102
108
|
- `target` — Set to `'17'` or `'18'` to target older React versions (uses `react-compiler-runtime` instead of `react/compiler-runtime`).
|
|
103
109
|
|
|
110
|
+
Additional options can be found in the [documentation](https://react.dev/reference/react-compiler/configuration).
|
|
111
|
+
|
|
104
112
|
```js
|
|
105
113
|
babel({
|
|
106
114
|
presets: [reactCompilerPreset({ compilationMode: 'annotation' })],
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Plugin } from "vite";
|
|
|
2
2
|
import { ReactCompilerBabelPluginOptions, RolldownBabelPreset } from "#optionalTypes";
|
|
3
3
|
|
|
4
4
|
//#region src/reactCompilerPreset.d.ts
|
|
5
|
-
declare const reactCompilerPreset: (options?:
|
|
5
|
+
declare const reactCompilerPreset: (options?: ReactCompilerBabelPluginOptions) => RolldownBabelPreset;
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/index.d.ts
|
|
8
8
|
interface Options {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-react",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "The default Vite plugin for React projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fast refresh",
|
|
@@ -43,21 +43,21 @@
|
|
|
43
43
|
"test-unit": "vitest run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@rolldown/pluginutils": "1.0.0
|
|
46
|
+
"@rolldown/pluginutils": "^1.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "8.0.0-rc.
|
|
50
|
-
"@rolldown/plugin-babel": "^0.2.
|
|
49
|
+
"@babel/core": "8.0.0-rc.4",
|
|
50
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
51
51
|
"@vitejs/react-common": "workspace:*",
|
|
52
52
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
53
|
-
"react": "^19.2.
|
|
54
|
-
"react-dom": "^19.2.
|
|
55
|
-
"rolldown": "1.0.0
|
|
56
|
-
"tsdown": "^0.
|
|
57
|
-
"vite": "^8.0.
|
|
53
|
+
"react": "^19.2.6",
|
|
54
|
+
"react-dom": "^19.2.6",
|
|
55
|
+
"rolldown": "^1.0.0",
|
|
56
|
+
"tsdown": "^0.22.0",
|
|
57
|
+
"vite": "^8.0.11"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@rolldown/plugin-babel": "^0.1.7",
|
|
60
|
+
"@rolldown/plugin-babel": "^0.1.7 || ^0.2.0",
|
|
61
61
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
62
62
|
"vite": "^8.0.0"
|
|
63
63
|
},
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"schemaVersion": 1,
|
|
77
77
|
"rolldown": {
|
|
78
78
|
"type": "compatible",
|
|
79
|
-
"versions": "^1.0.0
|
|
79
|
+
"versions": "^1.0.0",
|
|
80
80
|
"note": "You can use Rolldown's built-in feature directly."
|
|
81
81
|
},
|
|
82
82
|
"rollup": {
|