title: Error while configuring CSS modules with webpack
body: <p>I am trying to configure CSS modules with webpack but I get an error.</p>
  
  <p>I have checked the other answers here on stackoverflow but none of the solutions have made it work for me so far.</p>
  
  <p>I have added the loader as the docs suggest but it still shows an error.</p>
  
  <p>This is my webpack.configuration.js file.</p>
  
  <pre><code>const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  
  
  module.exports = {
      entry: './src/index.js',
      output: {
          path: path.join(__dirname, '/dist'),
          filename: 'index_bundle.js',
          publicPath: '/'
      },
      module: {
          rules: [
  
              {
                  test: /\.css$/,
                  loader: 'style-loader!css-loader?modules&amp;importLoaders=1&amp;localIdentName=[name]__[local]___[hash:base64:5]'
              },
  
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  use: {
                      loader: 'babel-loader'
                  }
              }
          ]
      },
      devServer: {
          historyApiFallback: true,
      },
      plugins: [
          new HtmlWebpackPlugin({
              template: './src/index.html'
          })
      ]
  }
  </code></pre>
  
  <p>The error I get is this.</p>
  
  <pre><code>ERROR in ./src/index.css (./node_modules/css-loader/dist/cjs.js?modules&amp;importLoaders=1&amp;localIdentName=[name]__[local]___[hash:base64:5]!./src/index.css)
      Module build failed (from ./node_modules/css-loader/dist/cjs.js):
      ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
       - options has an unknown property 'localIdentName'. These properties are valid:
         object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals? }
       - options.importLoaders should be one of these:
         boolean | number
         -&gt; Enables/Disables or setups number of loaders applied before CSS loader (https://github.com/webpack-contrib/css-loader#importloaders).
         Details:
          * options.importLoaders should be a boolean.
          * options.importLoaders should be a number.
          at validate (C:\Users\Arjun\Desktop\manpro\node_modules\css-loader\node_modules\schema-utils\dist\validate.js:49:11)
          at Object.loader (C:\Users\Arjun\Desktop\manpro\node_modules\css-loader\dist\index.js:34:28)
       @ ./src/index.css 1:14-150 20:4-31:5 23:25-161
       @ ./src/index.js
  
      ERROR in ./src/components/layout/Navbar.css (./node_modules/css-loader/dist/cjs.js?modules&amp;importLoaders=1&amp;localIdentName=[name]__[local]___[hash:base64:5]!./src/components/layout/Navbar.css)
      Module build failed (from ./node_modules/css-loader/dist/cjs.js):
      ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
       - options has an unknown property 'localIdentName'. These properties are valid
  </code></pre>
  
  <p>update: I was able to fix it with this:</p>
  
  <pre><code>{
              test: /\.css$/,
              use: [
                  'style-loader',
                  {
                      loader: 'css-loader',
                      options: {
                          importLoaders: 1,
                          modules: true
                      }
                  }
              ]
          }
  </code></pre>