import path from 'path' ; import { getDefault , pawExistsSync } from '../../globals' ; interface IDirectories { root : string ; src : string ; dist : string ; build : string ; } const projectRoot = path . normalize ( path . join ( __dirname , '..' , '..' , '..' ) ) ; let directories = { ... { root : path . resolve ( projectRoot , 'demo' ) , src : path . resolve ( projectRoot , 'demo' , 'src' ) , dist : path . join ( projectRoot , 'demo' , 'dist' ) , build : path . join ( projectRoot , 'demo' , 'dist' , 'build' ) , } , } ; if ( typeof process . env . PROJECT_ROOT !== 'undefined' ) { type { { root : string , src : string , dist : string , build : string } } directories = { root : process . env . PROJECT_ROOT , src : path . resolve ( process . env . PROJECT_ROOT , 'src' ) , dist : path . join ( process . env . PROJECT_ROOT , 'dist' ) , build : path . join ( process . env . PROJECT_ROOT , 'dist' , 'build' ) , } ; try { const directoriesConfigPath = pawExistsSync ( `${ process . env . PROJECT_ROOT }/directories` ) ; if ( directoriesConfigPath ) { directories = { ... directories , ... getDefault ( require ( directoriesConfigPath ) ) , } ; } } catch ( ex ) { } } export default { ... directories } ;