1.0.0 • Published 2 years ago

next-rules-overriding-modules v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Next.js Rules Overriding Modules

Make it easy to override the webpack rules in next.js.

Installation

npm install --save next-rules-overriding-modules

or

yarn add next-rules-overriding-modules

Usage

withROM(rules , options)

  • rules rules array for overriding
[
  {
    test: /\.module\.(scss|sass)$/,
    use: [
      {
        loader: /(\/|\\)css-loader/,
        options: {
          modules: {
            exportLocalsConvention: 'camelCase'
          }
        }
      }
    ]
  }
];
  • options Object (optional)
    • debug Boolean: Display some informative logs in the console (can get noisy!) (default to false)

Examples

// next.config.js
const withROM = require('next-rules-overriding-modules')([
  {
    test: /\.module\.(scss|sass)$/,
    use: [
      {
        loader: /(\/|\\)css-loader/,
        options: {
          modules: {
            exportLocalsConvention: 'camelCase'
          }
        }
      }
    ]
  }
]); // pass the rules you would like to override

module.exports = withROM({});