File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1210,12 +1210,17 @@ function vitePluginDefineEncryptionKey(
12101210 ]
12111211}
12121212
1213- function vitePluginUseServer (
1213+ export function vitePluginUseServer (
12141214 useServerPluginOptions : Pick <
12151215 RscPluginOptions ,
1216- 'ignoredPackageWarnings' | 'enableActionEncryption'
1216+ 'ignoredPackageWarnings' | 'enableActionEncryption' | 'environment'
12171217 > ,
12181218) : Plugin [ ] {
1219+ const serverEnvironments = useServerPluginOptions . environment ?. server ?? [
1220+ 'rsc' ,
1221+ ]
1222+ const isServer = ( name : string ) => serverEnvironments . includes ( name )
1223+
12191224 return [
12201225 {
12211226 name : 'rsc:use-server' ,
@@ -1249,7 +1254,7 @@ function vitePluginUseServer(
12491254 return normalizedId_
12501255 }
12511256
1252- if ( this . environment . name === 'rsc' ) {
1257+ if ( isServer ( this . environment . name ) ) {
12531258 const transformServerActionServer_ = withRollupError (
12541259 this ,
12551260 transformServerActionServer ,
You can’t perform that action at this time.
0 commit comments