function buildDocsEntry() {
  const output = join('docs/src/docs-entry.js');
  const getName = fullPath => fullPath.replace(/\/(en|zh)/, '.$1').split('/').pop().replace('.md', '');
  const docs = glob
    .sync([
      join('docs/**/*.md'),
      join('packages/**/*.md'),
      '!**/node_modules/**'
    ])
    .map(fullPath => {
      const name = getName(fullPath);
      return `'${name}': () => import('${path.relative(join('docs/src'), fullPath).replace(/\\/g, '/')}')`;
    });

  const content = `${tips}
export default {
  ${docs.join(',\n  ')}
};
`;
  fs.writeFileSync(output, content);
}
function buildDocsEntry() {
  const output = join('docs/src/docs-entry.js');
  const getName = fullPath => fullPath.replace(/\/(en|zh)/, '.$1').split('/').pop().replace('.md', '');
  const docs = glob
    .sync([
      join('docs/**/*.md'),
      join('packages/**/*.md'),
      '!**/node_modules/**'
    ])
    .map(fullPath => {
      const name = getName(fullPath);
      return `'${name}': () => import('${path.relative(join('docs/src'), fullPath).replace(/\\/g, '/')}')`;
    });

  const content = `${tips}
export default {
  ${docs.join(',\n  ')}
};
`;
  fs.writeFileSync(output, content);
}
function buildDocsEntry ( ) { const output = join ( 'docs/src/docs-entry.js' ) ; const getName = fullPath => fullPath . replace ( / \/(en|zh) / , '.$1' ) . split ( '/' ) . pop ( ) . replace ( '.md' , '' ) ; const docs = glob . sync ( [ join ( 'docs/**/*.md' ) , join ( 'packages/**/*.md' ) , '!**/node_modules/**' ] ) . map ( fullPath => { const name = getName ( fullPath ) ; return ` ${ name } ${ path . relative ( join ( 'docs/src' ) , fullPath ) . replace ( / \\ / g , '/' ) } ` ; } ) ; const content = ` ${ tips } ${ docs . join ( ',\n  ' ) } ` ; fs . writeFileSync ( output , content ) ; }
generate webpack entry file for markdown docs
generate webpack entry file for markdown docs
Build the docs - entry. js file