diff --git a/packages/plugin-react-swc/src/index.ts b/packages/plugin-react-swc/src/index.ts index 0a83a329..6b0371e7 100644 --- a/packages/plugin-react-swc/src/index.ts +++ b/packages/plugin-react-swc/src/index.ts @@ -75,7 +75,7 @@ type Options = { } const react = (_options?: Options): Plugin[] => { - let hmrDisabled = false + let hmrDisabled = true let viteCacheRoot: string | undefined const options = { jsxImportSource: _options?.jsxImportSource ?? 'react', @@ -133,7 +133,7 @@ const react = (_options?: Options): Plugin[] => { }), configResolved(config) { viteCacheRoot = config.cacheDir - if (config.server.hmr === false) hmrDisabled = true + hmrDisabled = config.server.hmr === false const mdxIndex = config.plugins.findIndex( (p) => p.name === '@mdx-js/rollup', )