Make it easy to override the webpack rules in next.js.
npm install --save next-rules-overriding-modules
or
yarn add next-rules-overriding-modules
-
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 tofalse
)
-
// 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({});