build/component-build.js
function build(info, sharedOpts={}, compOpts={}, pluginOpts={}) {
  const dir = process.cwd();
  const [org, name] = info.name.split('/');
  const outputPath = `${dir}/${config.outDir}`;

  console.log(chalk.cyan(`Building ${name}...\n`));
  return new Promise((resolve, reject)=>{
    rm(
      outputPath,
      (err) => {
        if (err) {
          // throw err
          reject(err);
        }
        webpack(createWebpackConfig(dir, name, sharedOpts, compOpts, pluginOpts), (err2, stats) => {
          if (err2) {
            // throw err2;
            reject(err2);
          }
          stats.stats.forEach(stat => {
            process.stdout.write(`${stat.toString({
              colors: true,
              modules: false,
              children: false,
              chunks: false,
              chunkModules: false,
            })}\n\n`);
          })
          console.log(chalk.cyan(`Build of ${name} complete.\n`));
          resolve();
        });
      }
    );

  });

}
function build(info, sharedOpts={}, compOpts={}, pluginOpts={}) {
  const dir = process.cwd();
  const [org, name] = info.name.split('/');
  const outputPath = `${dir}/${config.outDir}`;

  console.log(chalk.cyan(`Building ${name}...\n`));
  return new Promise((resolve, reject)=>{
    rm(
      outputPath,
      (err) => {
        if (err) {
          // throw err
          reject(err);
        }
        webpack(createWebpackConfig(dir, name, sharedOpts, compOpts, pluginOpts), (err2, stats) => {
          if (err2) {
            // throw err2;
            reject(err2);
          }
          stats.stats.forEach(stat => {
            process.stdout.write(`${stat.toString({
              colors: true,
              modules: false,
              children: false,
              chunks: false,
              chunkModules: false,
            })}\n\n`);
          })
          console.log(chalk.cyan(`Build of ${name} complete.\n`));
          resolve();
        });
      }
    );

  });

}
function build ( info , sharedOpts = { } , compOpts = { } , pluginOpts = { } ) { const dir = process . cwd ( ) ; const [ org , name ] = info . name . split ( '/' ) ; const outputPath = ` ${ dir } ${ config . outDir } ` ; console . log ( chalk . cyan ( ` ${ name } \n ` ) ) ; return new Promise ( ( resolve , reject ) => { rm ( outputPath , ( err ) => { if ( err ) { // throw err reject ( err ) ; } webpack ( createWebpackConfig ( dir , name , sharedOpts , compOpts , pluginOpts ) , ( err2 , stats ) => { if ( err2 ) { // throw err2; reject ( err2 ) ; } stats . stats . forEach ( stat => { process . stdout . write ( ` ${ stat . toString ( { colors : true , modules : false , children : false , chunks : false , chunkModules : false , } ) } \n \n ` ) ; } ) console . log ( chalk . cyan ( ` ${ name } \n ` ) ) ; resolve ( ) ; } ) ; } ) ; } ) ; }
Component build function
@param {Object} info -- package.json
@param {Object} sharedOpts -- webpack config for BOTH plugin/main that will be used in createWebpackConfig()
@param {Object} compOpts -- webpack config for main that will be used in createWebpackConfig()
@param {Object} pluginOpts -- webpack config for plugin that will be used in createWebpackConfig()
Component build function