File tree Expand file tree Collapse file tree
packages/cli/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,21 @@ export function registerBuildCommand(cli) {
5656 fs . cpSync ( src , dest , { recursive : true } ) ;
5757 console . log ( `Build successfully output to: ${ dest } ` ) ;
5858 } else {
59- console . log ( `\nNo 'out' directory generated in ${ src } .` ) ;
60- console . log ( `This is expected if 'output: export' is disabled.` ) ;
59+ // Check for .next directory (dynamic build)
60+ const srcNext = path . join ( nextAppDir , '.next' ) ;
61+ const destNext = path . join ( process . cwd ( ) , '.next' ) ;
62+
63+ if ( fs . existsSync ( srcNext ) && srcNext !== destNext ) {
64+ console . log ( `\nMoving .next build output to ${ destNext } ...` ) ;
65+ if ( fs . existsSync ( destNext ) ) {
66+ fs . rmSync ( destNext , { recursive : true , force : true } ) ;
67+ }
68+ fs . cpSync ( srcNext , destNext , { recursive : true } ) ;
69+ console . log ( `Build successfully output to: ${ destNext } ` ) ;
70+ } else {
71+ console . log ( `\nNo 'out' directory generated in ${ src } .` ) ;
72+ console . log ( `This is expected if 'output: export' is disabled.` ) ;
73+ }
6174 }
6275 }
6376 process . exit ( code ) ;
You can’t perform that action at this time.
0 commit comments