Unverified Commit 2a50c176 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Make HMR still apply updates when there is a webpack warning (#6099)

Fixes #5363

I noticed this happening when making some changes on the nextjs.org/learn app. Basically we didn't apply updates when a warning was emitted from webpack. This would cause issues for users using eslint-loader or similar too.
parent b20b371a
......@@ -216,7 +216,6 @@ function processMessage (e) {
if (obj.warnings.length > 0) {
handleWarnings(obj.warnings)
break
}
if (obj.errors.length > 0) {
......
const path = require('path')
module.exports = {
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60
},
webpack (config) {
config.module.rules.push({
test: /pages[\\/]hmr/,
loader: path.join(__dirname, 'warning-loader.js')
})
return config
}
}
module.exports = function (source) {
this.emitWarning(new Error('This is an expected warning added by warning-loader.js'))
return source
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment