@vitejs/plugin-react 3.1.0-beta.0 → 3.1.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/README.md +10 -0
- package/dist/refreshUtils.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -33,6 +33,16 @@ react({
|
|
33
33
|
})
|
34
34
|
```
|
35
35
|
|
36
|
+
### Configure the JSX import source
|
37
|
+
|
38
|
+
Control where the JSX factory is imported from. This option is ignored for classic `jsxRuntime`.
|
39
|
+
|
40
|
+
```js
|
41
|
+
react({
|
42
|
+
jsxImportSource: '@emotion/react',
|
43
|
+
})
|
44
|
+
```
|
45
|
+
|
36
46
|
## Opting out of the automatic JSX runtime
|
37
47
|
|
38
48
|
By default, the plugin uses the [automatic JSX runtime](https://github.com/alloc/vite-react-jsx#faq). However, if you encounter any issues, you may opt out using the `jsxRuntime` option.
|
package/dist/refreshUtils.js
CHANGED
@@ -6,6 +6,7 @@ function debounce(fn, delay) {
|
|
6
6
|
}
|
7
7
|
}
|
8
8
|
|
9
|
+
/* eslint-disable no-undef */
|
9
10
|
const enqueueUpdate = debounce(exports.performReactRefresh, 16)
|
10
11
|
|
11
12
|
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
|
@@ -38,7 +39,7 @@ function validateRefreshBoundaryAndEnqueueUpdate(prevExports, nextExports) {
|
|
38
39
|
if (hasExports && allExportsAreComponentsOrUnchanged) {
|
39
40
|
enqueueUpdate()
|
40
41
|
} else {
|
41
|
-
return 'Could not Fast Refresh. Learn more at https://github.com/vitejs/vite-plugin-react#consistent-components-exports'
|
42
|
+
return 'Could not Fast Refresh. Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports'
|
42
43
|
}
|
43
44
|
}
|
44
45
|
|