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