@@ -11,6 +11,7 @@ import path from 'pathe';
1111import type {
1212 EntryInfo ,
1313 NormalizedProjectConfig ,
14+ ProjectContext ,
1415 RstestContext ,
1516} from '../types' ;
1617import { isDebug } from '../utils' ;
@@ -65,16 +66,23 @@ export const prepareRsbuild = async (
6566 globTestSourceEntries : ( name : string ) => Promise < Record < string , string > > ,
6667 setupFiles : Record < string , Record < string , string > > ,
6768 globalSetupFiles : Record < string , Record < string , string > > ,
69+ /**
70+ * Explicit list of node-mode projects to include in the Rsbuild instance.
71+ * When provided, only these projects will be compiled.
72+ */
73+ targetNodeProjects ?: ProjectContext [ ] ,
6874) : Promise < RsbuildInstance > => {
6975 const {
7076 command,
7177 normalizedConfig : { isolate, dev = { } , coverage, pool } ,
7278 } = context ;
7379
7480 // Filter out browser mode projects - this rsbuild is for node mode only
75- const projects = context . projects . filter (
76- ( project ) => ! project . normalizedConfig . browser . enabled ,
77- ) ;
81+ const projects = targetNodeProjects ?. length
82+ ? targetNodeProjects
83+ : context . projects . filter (
84+ ( project ) => ! project . normalizedConfig . browser . enabled ,
85+ ) ;
7886 const debugMode = isDebug ( ) ;
7987
8088 RsbuildLogger . level = debugMode ? 'verbose' : 'error' ;
0 commit comments