-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
27 lines (23 loc) · 794 Bytes
/
Copy pathnext.config.js
File metadata and controls
27 lines (23 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const path = require('path');
const nextConfig = {
reactStrictMode: true,
webpack: (config) => {
const rules = config.module.rules
.find((rule) => typeof rule.oneOf === 'object')
.oneOf.filter((rule) => Array.isArray(rule.use));
rules.forEach((rule) => {
rule.use.forEach((moduleLoader) => {
if (/css-loader[/\\](?:cjs|dist|src)/.test(moduleLoader.loader)) {
if (typeof moduleLoader.options.modules === 'object') {
moduleLoader.options.modules = {
...moduleLoader.options.modules,
exportLocalsConvention: 'dashes', // https://github.com/webpack-contrib/css-loader#exportlocalsconvention
};
}
}
});
});
return config;
},
};
module.exports = nextConfig;