File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,21 @@ export function registerBuildCommand(cli) {
2424 nextAppDir = path . resolve ( __dirname , '../../../site' ) ;
2525 }
2626
27+ // Copy user config and assets to nextAppDir
28+ const userConfigPath = path . resolve ( process . cwd ( ) , 'objectdocs.json' ) ;
29+ if ( fs . existsSync ( userConfigPath ) ) {
30+ console . log ( ` Copying config from ${ userConfigPath } ` ) ;
31+ fs . cpSync ( userConfigPath , path . join ( nextAppDir , 'objectdocs.json' ) ) ;
32+ }
2733
2834 const userPublicPath = path . resolve ( process . cwd ( ) , 'public' ) ;
2935 if ( fs . existsSync ( userPublicPath ) ) {
30- fs . cpSync ( userPublicPath , path . join ( nextAppDir , 'public' ) , { recursive : true } ) ;
36+ console . log ( ` Copying public assets from ${ userPublicPath } ` ) ;
37+ const targetPublicDir = path . join ( nextAppDir , 'public' ) ;
38+ if ( ! fs . existsSync ( targetPublicDir ) ) {
39+ fs . mkdirSync ( targetPublicDir , { recursive : true } ) ;
40+ }
41+ fs . cpSync ( userPublicPath , targetPublicDir , { recursive : true , force : true } ) ;
3142 }
3243
3344 console . log ( `Building docs site...` ) ;
You can’t perform that action at this time.
0 commit comments