survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

Eslint errors prevent reload #141

Closed Velenir closed 7 years ago

Velenir commented 7 years ago

Given eslint-loader configuration from 05-Splitting..., whenever webpack-dev-server tries to hot reload on code change and there are eslint errors in code it can't with the following in the browser console:

[WDS] App updated. Recompiling...
[WDS] Errors while compiling. Reload prevented.
// and then error logs

Webpack stumbles over these errors. I think it is better if errors (especially purely syntactic ones) are only reported. To enable that eslint-loader docs suggest turning errors to warnings with emitWarning: true option. That would make eslint-config into:

{
  test: /\.js$/,
  include: paths,
  enforce: 'pre',

  use: 'eslint-loader',
  options: {
    emitWarning: true
  }
}

Would you consider changing it? Or do you think it is better to not reload on some errors?

bebraw commented 7 years ago

Hi,

That's a great point. I think I'll change it to show warnings during development. It can still fail hard on a regular build, though.

Thanks for bringing this up.