You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-react-swc/README.md
+10
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,16 @@ react({
93
93
})
94
94
```
95
95
96
+
### reactRefreshHost
97
+
98
+
The `reactRefreshHost` option is only necessary in a module federation context. It allows HMR to work between a remote & host server. In your remote vite config you would add your host origin:
Under the hood this simply updates the react refresh url from "/@react-refresh" to "http://localhost:3000/@react-refresh" to ensure you get only one Fast Refresh runtime in the whole application.
105
+
96
106
### useAtYourOwnRisk_mutateSwcOptions
97
107
98
108
The future of Vite is with OXC, and from the beginning this was a design choice to not exposed too many specialties from SWC so that Vite React users can move to another transformer later.
Copy file name to clipboardExpand all lines: packages/plugin-react/README.md
+10
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,16 @@ This option does not enable _code transformation_. That is handled by esbuild.
94
94
95
95
Here's the [complete list of Babel parser plugins](https://babeljs.io/docs/en/babel-parser#ecmascript-proposalshttpsgithubcombabelproposals).
96
96
97
+
### reactRefreshHost
98
+
99
+
The `reactRefreshHost` option is only necessary in a module federation context. It allows HMR to work between a remote & host server. In your remote vite config you would add your host origin:
Under the hood this simply updates the react refresh url from "/@react-refresh" to "http://localhost:3000/@react-refresh" to ensure you get only one Fast Refresh runtime in the whole application.
106
+
97
107
## Middleware mode
98
108
99
109
In [middleware mode](https://vite.dev/config/server-options.html#server-middlewaremode), you should make sure your entry `index.html` file is transformed by Vite. Here's an example for an Express server:
0 commit comments