packages/@vuepress/core/lib/node/theme-api/index.js
function resolveSFCs (dirs) {
  return dirs.map(
    layoutDir => readdirSync(layoutDir)
      .filter(filename => filename.endsWith('.vue'))
      .map(filename => {
        const componentName = getComponentName(filename)
        return {
          filename,
          componentName,
          isInternal: isInternal(componentName),
          path: resolve(layoutDir, filename)
        }
      })
  ).reduce((arr, next) => {
    arr.push(...next)
    return arr
  }, []).reduce((map, component) => {
    map[component.componentName] = component
    return map
  }, {})
}
function resolveSFCs (dirs) {
  return dirs.map(
    layoutDir => readdirSync(layoutDir)
      .filter(filename => filename.endsWith('.vue'))
      .map(filename => {
        const componentName = getComponentName(filename)
        return {
          filename,
          componentName,
          isInternal: isInternal(componentName),
          path: resolve(layoutDir, filename)
        }
      })
  ).reduce((arr, next) => {
    arr.push(...next)
    return arr
  }, []).reduce((map, component) => {
    map[component.componentName] = component
    return map
  }, {})
}
function resolveSFCs ( dirs ) { return dirs . map ( layoutDir => readdirSync ( layoutDir ) . filter ( filename => filename . endsWith ( '.vue' ) ) . map ( filename => { const componentName = getComponentName ( filename ) return { filename , componentName , isInternal : isInternal ( componentName ) , path : resolve ( layoutDir , filename ) } } ) ) . reduce ( ( arr , next ) => { arr . push ( ... next ) return arr } , [ ] ) . reduce ( ( map , component ) => { map [ component . componentName ] = component return map } , { } ) }
Resolve Vue SFCs, return a Map

@param dirs
@returns {*}
Resolve Vue SFCs return a Map