Skip to content

Commit 9faea2e

Browse files
Copilothi-ogawa
andcommitted
Add documentation and package.json metadata for optional react-server-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 <[email protected]>
1 parent bb0a5d7 commit 9faea2e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/plugin-rsc/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,16 @@ export default defineConfig({
386386

387387
## RSC runtime (react-server-dom) API
388388

389+
> **Note**: By default, `@vitejs/plugin-rsc` includes a vendored version of `react-server-dom-webpack`. However, if you have `react-server-dom-webpack` installed in your project's dependencies, the plugin will automatically use your version instead. This allows you to stay up-to-date with the latest React Server Components runtime without waiting for plugin updates.
390+
>
391+
> To use your own version, simply install it:
392+
>
393+
> ```bash
394+
> npm install react-server-dom-webpack
395+
> # or
396+
> pnpm add react-server-dom-webpack
397+
> ```
398+
389399
### `@vitejs/plugin-rsc/rsc`
390400
391401
This module re-exports RSC runtime API provided by `react-server-dom/server.edge` and `react-server-dom/client.edge` such as:

packages/plugin-rsc/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,10 @@
6868
"react": "*",
6969
"react-dom": "*",
7070
"vite": "*"
71+
},
72+
"peerDependenciesMeta": {
73+
"react-server-dom-webpack": {
74+
"optional": true
75+
}
7176
}
7277
}

0 commit comments

Comments
 (0)