Skip to content
18 changes: 11 additions & 7 deletions packages/plugin-rsc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,17 @@ export default defineConfig({
// this behavior can be customized by `serverHandler` option.
serverHandler: false,

// this controls build-time validation of 'server-only' and 'client-only' imports.
// this is enabled by default.
validateImports: true,

Choose a reason for hiding this comment

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

Ooh, that's really nice!


// by default, the plugin uses a build-time generated encryption key for
// "use server" closure argument binding.
// This can be overwritten by configuring `defineEncryptionKey` option,
// for example, to obtain a key through environment variable during runtime.
// cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
defineEncryptionKey: 'process.env.MY_ENCRYPTION_KEY',

// when `loadModuleDevProxy: true`, `import.meta.viteRsc.loadModule` is implemented
// through `fetch` based RPC, which allows, for example, rsc environment inside
// cloudflare workers to communicate with node ssr environment on main Vite process.
Expand All @@ -362,13 +373,6 @@ export default defineConfig({
// if it breaks, it can be opt-out or selectively applied based on files.
rscCssTransform: { filter: (id) => id.includes('/my-app/') },

// by default, the plugin uses a build-time generated encryption key for
// "use server" closure argument binding.
// This can be overwritten by configuring `defineEncryptionKey` option,
// for example, to obtain a key through environment variable during runtime.
// cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
defineEncryptionKey: 'process.env.MY_ENCRYPTION_KEY',

// see `RscPluginOptions` for full options ...
}),
],
Expand Down
Loading