examples/async-await-proc-options/scripts/start.js
function formatMessage(message) {
  return message
    // Make some common errors shorter:
    .replace(
      // Babel syntax error
      'Module build failed: SyntaxError:',
      friendlySyntaxErrorLabel
    )
    .replace(
      // Webpack file not found error
      /Module not found: Error: Cannot resolve 'file' or 'directory'/,
      'Module not found:'
    )
    // Internal stacks are generally useless so we strip them
    .replace(/^\s*at\s.*:\d+:\d+[\s\)]*\n/gm, '') // at ... ...:x:y
    // Webpack loader names obscure CSS filenames
    .replace('./~/css-loader!./~/postcss-loader!', '');
}
function formatMessage(message) {
  return message
    // Make some common errors shorter:
    .replace(
      // Babel syntax error
      'Module build failed: SyntaxError:',
      friendlySyntaxErrorLabel
    )
    .replace(
      // Webpack file not found error
      /Module not found: Error: Cannot resolve 'file' or 'directory'/,
      'Module not found:'
    )
    // Internal stacks are generally useless so we strip them
    .replace(/^\s*at\s.*:\d+:\d+[\s\)]*\n/gm, '') // at ... ...:x:y
    // Webpack loader names obscure CSS filenames
    .replace('./~/css-loader!./~/postcss-loader!', '');
}
function formatMessage ( message ) { return message // Make some common errors shorter: . replace ( // Babel syntax error 'Module build failed: SyntaxError:' , friendlySyntaxErrorLabel ) . replace ( // Webpack file not found error / Module not found: Error: Cannot resolve 'file' or 'directory' / , 'Module not found:' ) // Internal stacks are generally useless so we strip them . replace ( / ^\s*at\s.*:\d+:\d+[\s\)]*\n / gm , '' ) // at ... ...:x:y // Webpack loader names obscure CSS filenames . replace ( './~/css-loader!./~/postcss-loader!' , '' ) ; }
This is a little hacky. It would be easier if webpack provided a rich error object.
This is a little hacky . It would be easier if webpack provided a rich error object .