function compile(config, cb) {
  let compiler;
  try {
    compiler = webpack(config);
  } catch (e) {
    printErrors('Failed to compile.', [e]);
    process.exit(1);
  }
  compiler.run((err, stats) => {
    cb(err, stats);
  });
}
function compile(config, cb) {
  let compiler;
  try {
    compiler = webpack(config);
  } catch (e) {
    printErrors('Failed to compile.', [e]);
    process.exit(1);
  }
  compiler.run((err, stats) => {
    cb(err, stats);
  });
}
function compile ( config , cb ) { let compiler ; try { compiler = webpack ( config ) ; } catch ( e ) { printErrors ( 'Failed to compile.' , [ e ] ) ; process . exit ( 1 ) ; } compiler . run ( ( err , stats ) => { cb ( err , stats ) ; } ) ; }
Wrap webpack compile in a try catch.
Wrap webpack compile in a try catch .
Compile the webpack module.