Skip to content

Commit 6c05743

Browse files
authored
fix(plugin-swc): use SWC when useAtYourOwnRisk_mutateSwcOptions is provided (#951)
1 parent 165b5d5 commit 6c05743

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/plugin-react-swc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
SSR applications can now initialize HMR runtime by importing `@vitejs/plugin-react-swc/preamble` at the top of their client entry instead of manually calling `transformIndexHtml`. This simplifies SSR setup for applications that don't use the `transformIndexHtml` API.
88

9+
### Use SWC when useAtYourOwnRisk_mutateSwcOptions is provided ([#951](https://github.com/vitejs/vite-plugin-react/pull/951))
10+
11+
Previously, this plugin did not use SWC if plugins were not provided even if `useAtYourOwnRisk_mutateSwcOptions` was provided. This is now fixed.
12+
913
## 4.1.0 (2025-09-17)
1014

1115
### Set SWC cacheRoot options

packages/plugin-react-swc/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const react = (_options?: Options): Plugin[] => {
198198
return { code: newCode ?? result.code, map: result.map }
199199
},
200200
},
201-
options.plugins
201+
options.plugins || options.useAtYourOwnRisk_mutateSwcOptions
202202
? {
203203
name: 'vite:react-swc',
204204
apply: 'build',

0 commit comments

Comments
 (0)