Q:

CSS Modules doesn't work, React 16

I've installed css-loader and style-loader. Then I configured webpack.dev and webpack.prod.
I suppose there's a problem with webpack because component's syntax isn't complicated.
The component ignores styles.  Why?
package.json
"dependencies": {
    "css-loader": "^0.28.11",
    "prop-types": "^15.6.1",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.1",
    "style-loader": "^0.20.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject"`enter code here`: "react-scripts eject"  
  }

webpack.config.dev.js
 test: /\.css$/,
 use: [
    require.resolve('style-loader'),
    {
        loader: require.resolve('css-loader'),
        options: {
            importLoaders: 1,
            modules: true,
            localIdentName: '[name]__[local]__[hash:base64:5]'
        },
    },

webpack.config.prod.js
test: /\.css$/,
loader: ExtractTextPlugin.extract(
    Object.assign(
    {
        fallback: {
            loader: require.resolve('style-loader'),
            options: {
                hmr: false,
            },
        },
        use: [
        {
            loader: require.resolve('css-loader'),
            options: {
                importLoaders: 1,
                modules: true,
                localIdentName: '[name]__[local]__[hash:base64:5]',
                minimize: true,
                sourceMap: shouldUseSourceMap,
            },
        },

component
import React, { Component } from 'react';
import styles from './addTask.css';

export default class AddTask extends Component {
  render() {
    return (
      <div className={styles.big}>
        this should be a big font
      </div>
    );
  }
}

css for the component
.big {
    font-size: 111px;
}

A:

rename addTask.css to addTask.module.css and change the import to import styles from './addTask.module.css'

