@@ -353,6 +353,17 @@ export default defineConfig({
353
353
// this behavior can be customized by `serverHandler` option.
354
354
serverHandler: false ,
355
355
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
+
356
367
// when `loadModuleDevProxy: true`, `import.meta.viteRsc.loadModule` is implemented
357
368
// through `fetch` based RPC, which allows, for example, rsc environment inside
358
369
// cloudflare workers to communicate with node ssr environment on main Vite process.
@@ -362,13 +373,6 @@ export default defineConfig({
362
373
// if it breaks, it can be opt-out or selectively applied based on files.
363
374
rscCssTransform: { filter : (id ) => id .includes (' /my-app/' ) },
364
375
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
-
372
376
// see `RscPluginOptions` for full options ...
373
377
}),
374
378
],
0 commit comments