File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,8 @@ import.meta.hot.on('rsc:update', async () => {
355355
356356### ` @vitejs/plugin-rsc `
357357
358+ - Type: ` rsc: (options?: RscPluginOptions) => Plugin[] ` ;
359+
358360``` js
359361import rsc from ' @vitejs/plugin-rsc'
360362import { defineConfig } from ' vite'
@@ -390,8 +392,14 @@ export default defineConfig({
390392 // for example, to obtain a key through environment variable during runtime.
391393 // cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
392394 defineEncryptionKey: ' process.env.MY_ENCRYPTION_KEY' ,
395+
396+ // see `RscPluginOptions` for full options ...
393397 }),
394398 ],
399+ // the same options can be also specified via top-level `rsc` property.
400+ rsc: {
401+ // ...
402+ },
395403})
396404```
397405
Original file line number Diff line number Diff line change @@ -309,6 +309,12 @@ export default function vitePluginRsc(
309309 {
310310 name : 'rsc' ,
311311 async config ( config , env ) {
312+ if ( config . rsc ) {
313+ Object . assign (
314+ rscPluginOptions ,
315+ vite . mergeConfig ( config . rsc , rscPluginOptions ) ,
316+ )
317+ }
312318 // crawl packages with "react" in "peerDependencies" to bundle react deps on server
313319 // see https://github.com/svitejs/vitefu/blob/d8d82fa121e3b2215ba437107093c77bde51b63b/src/index.js#L95-L101
314320 const result = await crawlFrameworkPkgs ( {
You can’t perform that action at this time.
0 commit comments