From 9d96c436c2dce537f1b286149212a480e8070cbc Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Fri, 26 Jan 2018 09:38:09 +0100 Subject: [PATCH 1/6] fix: Allow css-modules HMR when classes are unchanged Fixes webpack-contrib/css-loader#669. Previously, HMR was disabled if css-modules was enabled (in css-loader) and at least one class was present in the file. This was because JS files depend on the classes, and as such have to be reloaded when the CSS changes in case the classes have changed. Now, HMR _is_ used if no classes change. Othewise the whole page is reloaded like before. --- index.js | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 0179a4c0..abe355ba 100644 --- a/index.js +++ b/index.js @@ -23,13 +23,34 @@ module.exports.pitch = function (request) { "// Hot Module Replacement", "if(module.hot) {", " // When the styles change, update the