Webpack dev server and css modules
<p>I can make <strong><em>css modules</em></strong> to work, but not in the hot-reload.</p>

<p>When first loaded, the style appears the way it should:</p>

<p><a href="https://i.stack.imgur.com/QjMsX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QjMsX.png" alt="Class names with css modules"></a></p>

<p>But after making changes to the css file it breaks, and a full reload is needed:</p>

<p><a href="https://i.stack.imgur.com/veRoY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/veRoY.png" alt="Hot reload not working for css modules"></a></p>

<p>I'm using the css modules as shown below:</p>

<p><a href="https://i.stack.imgur.com/5AZMc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5AZMc.png" alt="css import"></a></p>

<p><strong>webpack.config.js</strong></p>

<pre class="lang-js prettyprint-override"><code>const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const pack = {
  entry: [
    path.join(__dirname, 'src/app/index.js'),
  ],
  output: {
    path: path.join(__dirname, '/dist/'),
    filename: '[name].js',
    publicPath: '/',
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/app/index.html',
      inject: 'body',
      filename: 'index.html',
    }),
  ],
  module: {
    loaders: [
      {
        test: /\.css$/,
        include: /src\/app/,
        loaders: [
          'style?sourceMap',
          'css?modules&amp;importLoaders=1&amp;localIdentName=[path]___[name]__[local]___[hash:base64:5]',
        ],
      },
      {
        test: /\.js?$/,
        include: /src\/app/,
        loader: 'babel',
      },
      {
        test: /\.woff(2)?(\?[a-z0-9#=&amp;.]+)?$/,
        loader: 'url?limit=10000&amp;mimetype=application/font-woff',
      },
      {
        test: /\.(ttf|eot|svg)(\?[a-z0-9#=&amp;.]+)?$/,
        loader: 'file',
      },
    ],
  },
};

module.exports = pack;
</code></pre>

<p><strong>webpack.development.config.js</strong></p>

<pre><code>const webpack = require('webpack');

const pack = require('./webpack.config');

pack.entry.unshift('react-hot-loader/patch');
pack.entry.unshift('webpack/hot/only-dev-server');
pack.entry.unshift('webpack-dev-server/client?http://localhost:3000');

pack.plugins.push(new webpack.HotModuleReplacementPlugin());
pack.plugins.push(new webpack.DefinePlugin({
  'process.env.NODE_ENV': JSON.stringify('development'),
}));

module.exports = pack;
</code></pre>

<p>As I have noticed, the css class that it tries to fetch in the component stills the same, shouldn't a new hash be generated for each file change/reload?</p>