Skip to content

Commit 08eda48

Browse files
committed
chore: tweak
1 parent 6abcb7e commit 08eda48

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export type RscPluginOptions = {
119119
keepUseCientProxy?: boolean
120120

121121
/**
122-
* Build-time validation for client-only and server-only imports
122+
* Enable build-time validation of 'client-only' and 'server-only' imports
123123
* @default true
124124
*/
125125
validateImports?: boolean
@@ -418,10 +418,6 @@ export default function vitePluginRsc(
418418
}
419419
},
420420
},
421-
// conditionally add import validation plugin
422-
...(rscPluginOptions.validateImports !== false
423-
? [validateImportPlugin()]
424-
: []),
425421
{
426422
name: 'rsc:patch-browser-raw-import',
427423
transform: {
@@ -817,6 +813,9 @@ globalThis.AsyncLocalStorage = __viteRscAyncHooks.AsyncLocalStorage;
817813
...vitePluginDefineEncryptionKey(rscPluginOptions),
818814
...vitePluginFindSourceMapURL(),
819815
...vitePluginRscCss({ rscCssTransform: rscPluginOptions.rscCssTransform }),
816+
...(rscPluginOptions.validateImports !== false
817+
? [validateImportPlugin()]
818+
: []),
820819
scanBuildStripPlugin(),
821820
]
822821
}

0 commit comments

Comments
 (0)