@@ -148,6 +148,7 @@ export type BuildResult = {
148148export async function getResults (
149149 rslibConfig : RslibConfig ,
150150 type : 'js' | 'dts' | 'css' ,
151+ cwd : string ,
151152) : Promise < Omit < BuildResult , 'rspackConfig' | 'rsbuildConfig' | 'isSuccess' > > {
152153 const files : Record < string , string [ ] > = { } ;
153154 const contents : Record < string , Record < string , string > > = { } ;
@@ -202,6 +203,7 @@ export async function getResults(
202203 : / \. ( j s | c j s | m j s | j s x ) ( \. m a p ) ? $ / ;
203204
204205 const content : Record < string , string > = await globContentJSON ( globFolder , {
206+ cwd,
205207 absolute : true ,
206208 } ) ;
207209
@@ -334,9 +336,9 @@ export async function buildAndGetResults({
334336 origin : { bundlerConfigs, rsbuildConfig } ,
335337 } = await rslib . inspectConfig ( { verbose : true } ) ;
336338 if ( type === 'all' ) {
337- const jsResults = await getResults ( rslibConfig , 'js' ) ;
338- const dtsResults = await getResults ( rslibConfig , 'dts' ) ;
339- const cssResults = await getResults ( rslibConfig , 'css' ) ;
339+ const jsResults = await getResults ( rslibConfig , 'js' , fixturePath ) ;
340+ const dtsResults = await getResults ( rslibConfig , 'dts' , fixturePath ) ;
341+ const cssResults = await getResults ( rslibConfig , 'css' , fixturePath ) ;
340342 return {
341343 js : {
342344 contents : jsResults . contents ,
@@ -367,7 +369,7 @@ export async function buildAndGetResults({
367369 } ,
368370 } ;
369371 }
370- const results = await getResults ( rslibConfig , type ) ;
372+ const results = await getResults ( rslibConfig , type , fixturePath ) ;
371373 return {
372374 contents : results . contents ,
373375 files : results . files ,
0 commit comments