lib/deployer.js
async function _compileAssets(wwwDir, tmpDir) {
  const nodeDir = resolve(wwwDir, '../node_modules');
  const moduleDirs = (function _moduleDirs() {
    const dirs = [wwwDir];
    if (fs.existsSync(nodeDir)) dirs.push(nodeDir);
    return dirs;
  }());

  const config = webPackConfig('production', tmpDir, moduleDirs, tmpDir);
  if (Utils.isEmpty(config.entry)) return;

  const compiler = Webpack(config);
  await new Promise((_resolve, _reject) => {
    compiler.run((err, stats) => {
      if (stats.hasErrors()) {
        _reject(new Error('Failed to compile assets'));
      }

      _resolve();
    });
  });
}
async function _compileAssets(wwwDir, tmpDir) {
  const nodeDir = resolve(wwwDir, '../node_modules');
  const moduleDirs = (function _moduleDirs() {
    const dirs = [wwwDir];
    if (fs.existsSync(nodeDir)) dirs.push(nodeDir);
    return dirs;
  }());

  const config = webPackConfig('production', tmpDir, moduleDirs, tmpDir);
  if (Utils.isEmpty(config.entry)) return;

  const compiler = Webpack(config);
  await new Promise((_resolve, _reject) => {
    compiler.run((err, stats) => {
      if (stats.hasErrors()) {
        _reject(new Error('Failed to compile assets'));
      }

      _resolve();
    });
  });
}
async function _compileAssets ( wwwDir , tmpDir ) { const nodeDir = resolve ( wwwDir , '../node_modules' ) ; const moduleDirs = ( function _moduleDirs ( ) { const dirs = [ wwwDir ] ; if ( fs . existsSync ( nodeDir ) ) dirs . push ( nodeDir ) ; return dirs ; } ( ) ) ; const config = webPackConfig ( 'production' , tmpDir , moduleDirs , tmpDir ) ; if ( Utils . isEmpty ( config . entry ) ) return ; const compiler = Webpack ( config ) ; await new Promise ( ( _resolve , _reject ) => { compiler . run ( ( err , stats ) => { if ( stats . hasErrors ( ) ) { _reject ( new Error ( 'Failed to compile assets' ) ) ; } _resolve ( ) ; } ) ; } ) ; }
Compiles Webpack assets
Compiles Webpack assets