@@ -540,6 +540,22 @@ function showMigrationSummary(options: {
540540 }
541541}
542542
543+ async function checkRolldownCompatibility ( rootDir : string , report : MigrationReport ) : Promise < void > {
544+ try {
545+ const { resolveConfig } = await import ( '../index.js' ) ;
546+ const { checkManualChunksCompat } = await import ( './compat.js' ) ;
547+ // Use 'runner' configLoader to avoid Rolldown bundling the config file,
548+ // which prints UNRESOLVED_IMPORT warnings that cannot be suppressed via logLevel.
549+ const config = await resolveConfig (
550+ { root : rootDir , logLevel : 'silent' , configLoader : 'runner' } ,
551+ 'build' ,
552+ ) ;
553+ checkManualChunksCompat ( config . build ?. rollupOptions ?. output , report ) ;
554+ } catch {
555+ // Config resolution may fail — skip compatibility check silently
556+ }
557+ }
558+
543559async function executeMigrationPlan (
544560 workspaceInfoOptional : WorkspaceInfoOptional ,
545561 plan : MigrationPlan ,
@@ -637,7 +653,16 @@ async function executeMigrationPlan(
637653 cancelAndExit ( 'Vite+ cannot automatically migrate this project yet.' , 1 ) ;
638654 }
639655
640- // 5. ESLint → Oxlint migration (before main rewrite so .oxlintrc.json gets picked up)
656+ // 5. Check for Rolldown-incompatible config patterns (root + workspace packages)
657+ updateMigrationProgress ( 'Checking config compatibility' ) ;
658+ await checkRolldownCompatibility ( workspaceInfo . rootDir , report ) ;
659+ if ( workspaceInfo . packages ) {
660+ for ( const pkg of workspaceInfo . packages ) {
661+ await checkRolldownCompatibility ( path . join ( workspaceInfo . rootDir , pkg . path ) , report ) ;
662+ }
663+ }
664+
665+ // 6. ESLint → Oxlint migration (before main rewrite so .oxlintrc.json gets picked up)
641666 if ( plan . migrateEslint ) {
642667 updateMigrationProgress ( 'Migrating ESLint' ) ;
643668 const eslintOk = await migrateEslintToOxlint (
@@ -725,6 +750,7 @@ async function executeMigrationPlan(
725750 installArgs ,
726751 { silent : true } ,
727752 ) ;
753+
728754 clearMigrationProgress ( ) ;
729755 return {
730756 installDurationMs : initialInstallSummary . durationMs + finalInstallSummary . durationMs ,
@@ -825,7 +851,18 @@ async function main() {
825851 }
826852 }
827853
828- if ( didMigrate ) {
854+ // Check for Rolldown-incompatible config patterns (root + workspace packages)
855+ await checkRolldownCompatibility ( workspaceInfoOptional . rootDir , report ) ;
856+ if ( workspaceInfoOptional . packages ) {
857+ for ( const pkg of workspaceInfoOptional . packages ) {
858+ await checkRolldownCompatibility (
859+ path . join ( workspaceInfoOptional . rootDir , pkg . path ) ,
860+ report ,
861+ ) ;
862+ }
863+ }
864+
865+ if ( didMigrate || report . warnings . length > 0 ) {
829866 clearMigrationProgress ( ) ;
830867 showMigrationSummary ( {
831868 projectRoot : workspaceInfoOptional . rootDir ,
0 commit comments