Skip to content

Commit 897a3be

Browse files
authored
fix(react-swc): fix @vitejs/plugin-react-swc/preamble on build (#962)
1 parent 5907c63 commit 897a3be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type Options = {
7575
}
7676

7777
const react = (_options?: Options): Plugin[] => {
78-
let hmrDisabled = false
78+
let hmrDisabled = true
7979
let viteCacheRoot: string | undefined
8080
const options = {
8181
jsxImportSource: _options?.jsxImportSource ?? 'react',
@@ -133,7 +133,7 @@ const react = (_options?: Options): Plugin[] => {
133133
}),
134134
configResolved(config) {
135135
viteCacheRoot = config.cacheDir
136-
if (config.server.hmr === false) hmrDisabled = true
136+
hmrDisabled = config.server.hmr === false
137137
const mdxIndex = config.plugins.findIndex(
138138
(p) => p.name === '@mdx-js/rollup',
139139
)

0 commit comments

Comments
 (0)