@vitejs/plugin-react-swc
Advanced tools
Comparing version
@@ -33,2 +33,10 @@ import { type JscTarget, type ParserConfig, type Options as SWCOptions } from '@swc/core'; | ||
/** | ||
* React Fast Refresh runtime URL prefix. | ||
* Useful in a module federation context to enable HMR by specifying | ||
* the host application URL in a Vite config of a remote application. | ||
* @example | ||
* reactRefreshHost: 'http://localhost:3000' | ||
*/ | ||
reactRefreshHost?: string; | ||
/** | ||
* The future of Vite is with OXC, and from the beginning this was a design choice | ||
@@ -35,0 +43,0 @@ * to not exposed too many specialties from SWC so that Vite React users can move to |
{ | ||
"name": "@vitejs/plugin-react-swc", | ||
"version": "3.9.0-beta.2", | ||
"version": "3.9.0-beta.3", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "author": "Arnaud Barré (https://github.com/ArnaudBarre)", | ||
"dependencies": { | ||
"@swc/core": "^1.11.11" | ||
"@swc/core": "^1.11.21" | ||
}, | ||
@@ -29,0 +29,0 @@ "peerDependencies": { |
@@ -96,2 +96,12 @@ # @vitejs/plugin-react-swc [](https://www.npmjs.com/package/@vitejs/plugin-react-swc) | ||
### reactRefreshHost | ||
The `reactRefreshHost` option is only necessary in a module federation context. It enables HMR to work between a remote & host application. In your remote Vite config, you would add your host origin: | ||
```js | ||
react({ reactRefreshHost: 'http://localhost:3000' }) | ||
``` | ||
Under the hood, this simply updates the React Fash Refresh runtime URL from `/@react-refresh` to `http://localhost:3000/@react-refresh` to ensure there is only one Refresh runtime across the whole application. Note that if you define `base` option in the host application, you need to include it in the option, like: `http://localhost:3000/{base}`. | ||
### useAtYourOwnRisk_mutateSwcOptions | ||
@@ -98,0 +108,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40974
3.15%1023
1.19%127
8.55%Updated