-
-
Notifications
You must be signed in to change notification settings - Fork 205
feat(rsc): use locally installed react-server-dom-webpack when available
#915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add getReactServerDomPackageName() helper to detect user's package - Create alias plugin to redirect vendored imports to user's package - Update config to use dynamic package name in optimizeDeps Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
…-dom-webpack - Add peerDependenciesMeta to mark react-server-dom-webpack as optional - Add documentation section explaining the dynamic resolution feature Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with Vite plugin React causing build errors
fix(plugin-rsc): dynamically use user's react-server-dom-webpack when available
Oct 8, 2025
Copilot finished work on behalf of
hi-ogawa
October 8, 2025 06:25
8 tasks
react-server-dom-webpack when available
react-server-dom-webpack when availablereact-server-dom-webpack when available
react-server-dom-webpack when availablereact-server-dom-webpack when available
react-server-dom-webpack when availablereact-server-dom-webpack when available
commit: |
Contributor
|
@dai-shi This has been implemented and Waku CI is passing. https://github.com/vitejs/vite-ecosystem-ci/actions/runs/18338297753 |
hi-ogawa
approved these changes
Oct 8, 2025
|
Thaaanks! |
dai-shi
pushed a commit
to wakujs/waku
that referenced
this pull request
Oct 9, 2025
…m-webpack` (#1718) - Adopting vitejs/vite-plugin-react#915
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #913
Ecosystem ci run
copilot
Summary
This PR enables
@vitejs/plugin-rscto automatically detect and usereact-server-dom-webpackfrom the user's project dependencies when available, while maintaining backward compatibility with the vendored version.Motivation
Previously, the plugin always used a bundled (vendored) version of
react-server-dom-webpack. This meant:Changes
1. Dynamic Package Detection
Added
getReactServerDomPackageName()function that:react-server-dom-webpackfrom the user's project root@vitejs/plugin-rsc/vendor/react-server-dom) if not foundcreateRequireto check from the project's package.json location2. Import Aliasing
Created
rsc:react-server-dom-aliasVite plugin that:@vitejs/plugin-rsc/vendor/react-server-dom/*react-server-dom-webpackwhen detected/client.browser,/server.edge)3. Configuration Updates
Modified Vite environment configs to:
optimizeDeps.includefor all environments (client, ssr, rsc)4. Package Metadata
peerDependenciesMetamarkingreact-server-dom-webpackas optional5. Documentation
Updated README with:
Usage
Users can now optionally install
react-server-dom-webpack:npm install react-server-dom-webpack # or pnpm add react-server-dom-webpackThe plugin will automatically detect and use it. No configuration needed.
If not installed, the plugin continues to work with the vendored version (zero breaking changes).
Benefits
Testing
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.