Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Correct the HMR plugin name for @vitejs/plugin-react-swc#816

Merged
gioboa merged 1 commit into
module-federation:mainfrom
truongnguyen-eh:fix/react-adapter-plugin-name
Jun 13, 2026
Merged

fix: Correct the HMR plugin name for @vitejs/plugin-react-swc#816
gioboa merged 1 commit into
module-federation:mainfrom
truongnguyen-eh:fix/react-adapter-plugin-name

Conversation

@truongnguyen-eh

Copy link
Copy Markdown
Contributor

Summary

Projects using @vitejs/plugin-react-swc currently fall back to full-page reload HMR because the plugin name used to detect native HMR support is incorrect.

The actual plugin name exposed by @vitejs/plugin-react-swc is vite:react-swc, as defined in the plugin implementation:
https://github.com/vitejs/vite-plugin-react/blob/013588199583c4ea8bbcc17ec39cb3ed1fea4e19/packages/plugin-react-swc/src/index.ts#L121

This PR updates the detection logic to use the correct plugin name, allowing projects that use @vitejs/plugin-react-swc to leverage native HMR instead of falling back to full-page reloads.

Testing

  • Applied the change locally using a patched version.
  • Verified that native HMR works correctly in a project using @vitejs/plugin-react-swc.
  • Confirmed that changes are updated without triggering a full-page reload.

@pkg-pr-new

pkg-pr-new Bot commented Jun 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@module-federation/vite@816

commit: 0b7a144

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @truongnguyen-eh
Nice catch 👏

@gioboa gioboa merged commit 8f51f8b into module-federation:main Jun 13, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants