modules/dev-tools/node/aliases.js
function getSubmodules(packageRoot) {
  const submodules = {};
  const parentPath = resolve(packageRoot, './modules');

  if (fs.existsSync(parentPath)) {
    //monorepo
    fs.readdirSync(parentPath)
    .forEach(item => {
      const itemPath = resolve(parentPath, item);
      const moduleInfo = getModuleInfo(itemPath);
      if (moduleInfo) {
        submodules[moduleInfo.name] = moduleInfo;
      }
    });
  } else {
    const moduleInfo = getModuleInfo(packageRoot);
    submodules[moduleInfo.name] = moduleInfo;
  }

  return submodules;
}
function getSubmodules(packageRoot) {
  const submodules = {};
  const parentPath = resolve(packageRoot, './modules');

  if (fs.existsSync(parentPath)) {
    //monorepo
    fs.readdirSync(parentPath)
    .forEach(item => {
      const itemPath = resolve(parentPath, item);
      const moduleInfo = getModuleInfo(itemPath);
      if (moduleInfo) {
        submodules[moduleInfo.name] = moduleInfo;
      }
    });
  } else {
    const moduleInfo = getModuleInfo(packageRoot);
    submodules[moduleInfo.name] = moduleInfo;
  }

  return submodules;
}
function getSubmodules ( packageRoot ) { const submodules = { } ; const parentPath = resolve ( packageRoot , './modules' ) ; if ( fs . existsSync ( parentPath ) ) { //monorepo fs . readdirSync ( parentPath ) . forEach ( item => { const itemPath = resolve ( parentPath , item ) ; const moduleInfo = getModuleInfo ( itemPath ) ; if ( moduleInfo ) { submodules [ moduleInfo . name ] = moduleInfo ; } } ) ; } else { const moduleInfo = getModuleInfo ( packageRoot ) ; submodules [ moduleInfo . name ] = moduleInfo ; } return submodules ; }
Get information of all submodules
Get information of all submodules