lib/compiler.js
function sanitize(config) {
  const configs = [].concat(config).map((conf) => {
    const result = merge({}, conf);
    delete result.progress;
    delete result.reporter;
    delete result.watchStdin;

    // TODO: remove the need for this
    for (const property of ['entry', 'output']) {
      const target = result[property];
      if (target && Object.keys(target).length === 0) {
        delete result[property];
      }
    }

    return result;
  });

  // if we always return an array, every compilation will be a MultiCompiler
  return configs.length > 1 ? configs : configs[0];
}
function sanitize(config) {
  const configs = [].concat(config).map((conf) => {
    const result = merge({}, conf);
    delete result.progress;
    delete result.reporter;
    delete result.watchStdin;

    // TODO: remove the need for this
    for (const property of ['entry', 'output']) {
      const target = result[property];
      if (target && Object.keys(target).length === 0) {
        delete result[property];
      }
    }

    return result;
  });

  // if we always return an array, every compilation will be a MultiCompiler
  return configs.length > 1 ? configs : configs[0];
}
function sanitize ( config ) { const configs = [ ] . concat ( config ) . map ( ( conf ) => { const result = merge ( { } , conf ) ; delete result . progress ; delete result . reporter ; delete result . watchStdin ; // TODO: remove the need for this for ( const property of [ 'entry' , 'output' ] ) { const target = result [ property ] ; if ( target && Object . keys ( target ) . length === 0 ) { delete result [ property ] ; } } return result ; } ) ; // if we always return an array, every compilation will be a MultiCompiler return configs . length > 1 ? configs : configs [ 0 ] ; }
Removes invalid webpack config properties leftover from applying flags
Removes invalid webpack config properties leftover from applying flags