title: How to enable css modules only for .mod.css files ? Nextjs
body: <p>There are two kind of styling files i use in my project <code>.css</code> files &amp; <code>.mod.css</code> files. I want to enable CSS modules only for the files whose extension is <code>*.mod.css</code>.</p>
  
  <p>My <code>next.config.js</code> file</p>
  
  <pre><code>const withCSS = require('@zeit/next-css')
  
  module.exports = withCSS({
        cssModules:true,
        cssLoaderOptions: {
          localIdentName: "[local]_[hash:base64:5]",
        },
        webpack(config, options) {
          config.module.rules.push({
            test: /\.mod.css$/,
          })
          return config
        }
  })
  </code></pre>