next-rules-overriding-modules
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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({});

Package Sidebar

Install

npm i next-rules-overriding-modules

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.93 kB

Total Files

5

Last publish

Collaborators

  • kidcer