@@ -352,6 +352,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) {
352352 ...localOverrides ,
353353 }
354354 }
355+ if ( options . rolldownRelease ) {
356+ overrides . rolldown = options . rolldownRelease
357+ }
355358 await applyPackageOverrides ( agent , dir , pkg , overrides )
356359 await beforeBuildCommand ?.( pkg . scripts )
357360 await buildCommand ?.( pkg . scripts )
@@ -414,12 +417,27 @@ export async function getPermanentRef() {
414417 }
415418}
416419
417- export async function buildVite ( { verify = false } ) {
420+ export async function buildVite ( {
421+ verify = false ,
422+ rolldownRelease,
423+ } : { verify ?: boolean ; rolldownRelease ?: string } = { } ) {
418424 cd ( vitePath )
425+
419426 const frozenInstall = getCommand ( 'pnpm' , 'frozen' )
420427 const runBuild = getCommand ( 'pnpm' , 'run' , [ 'build' ] )
421428 const runTest = getCommand ( 'pnpm' , 'run' , [ 'test' ] )
422- await $ `${ serializeCommand ( frozenInstall ) } `
429+
430+ if ( rolldownRelease ) {
431+ const pkgFile = path . join ( vitePath , 'package.json' )
432+ const pkg = JSON . parse ( await fs . promises . readFile ( pkgFile , 'utf-8' ) )
433+ // Override rolldown in vite's monorepo so it builds against the specified version
434+ await applyPackageOverrides ( 'pnpm' , vitePath , pkg , {
435+ rolldown : rolldownRelease ,
436+ } )
437+ console . log ( `overridden rolldown in vite repo with ${ rolldownRelease } ` )
438+ } else {
439+ await $ `${ serializeCommand ( frozenInstall ) } `
440+ }
423441 await $ `${ serializeCommand ( runBuild ) } `
424442 if ( verify ) {
425443 await $ `${ serializeCommand ( runTest ) } `
0 commit comments