Skip to content

Commit d51d399

Browse files
committed
docs(rsc): mention validateImports option
1 parent 954b361 commit d51d399

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

packages/plugin-rsc/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,17 @@ export default defineConfig({
353353
// this behavior can be customized by `serverHandler` option.
354354
serverHandler: false,
355355

356+
// by default, the plugin uses a build-time generated encryption key for
357+
// "use server" closure argument binding.
358+
// This can be overwritten by configuring `defineEncryptionKey` option,
359+
// for example, to obtain a key through environment variable during runtime.
360+
// cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
361+
defineEncryptionKey: 'process.env.MY_ENCRYPTION_KEY',
362+
363+
// this controls build-time validation of 'client-only' and 'server-only' imports.
364+
// this is enabled by default.
365+
validateImports: true,
366+
356367
// when `loadModuleDevProxy: true`, `import.meta.viteRsc.loadModule` is implemented
357368
// through `fetch` based RPC, which allows, for example, rsc environment inside
358369
// cloudflare workers to communicate with node ssr environment on main Vite process.
@@ -362,13 +373,6 @@ export default defineConfig({
362373
// if it breaks, it can be opt-out or selectively applied based on files.
363374
rscCssTransform: { filter: (id) => id.includes('/my-app/') },
364375

365-
// by default, the plugin uses a build-time generated encryption key for
366-
// "use server" closure argument binding.
367-
// This can be overwritten by configuring `defineEncryptionKey` option,
368-
// for example, to obtain a key through environment variable during runtime.
369-
// cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
370-
defineEncryptionKey: 'process.env.MY_ENCRYPTION_KEY',
371-
372376
// see `RscPluginOptions` for full options ...
373377
}),
374378
],

0 commit comments

Comments
 (0)