Modify next.js to re-enable CSS modules
This commit is contained in:
parent
8cbdb1838d
commit
39245e3e88
1 changed files with 14 additions and 4 deletions
|
|
@ -54,14 +54,24 @@ module.exports = {
|
|||
]
|
||||
},
|
||||
webpack(config) {
|
||||
// Set up alias for styles
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
'@styles': path.resolve(__dirname, 'styles'),
|
||||
}
|
||||
|
||||
// Set up rules for SVG files
|
||||
config.module.rules.push({
|
||||
test: /\.svg$/,
|
||||
use: ['@svgr/webpack'],
|
||||
})
|
||||
config.module.rules[2].oneOf.forEach((one) => {
|
||||
if (!`${one.issuer?.and}`.includes('_app')) return
|
||||
one.issuer.and = [path.resolve(__dirname)]
|
||||
})
|
||||
|
||||
// Disable CSS modules
|
||||
// config.module.rules[2].oneOf.forEach((one) => {
|
||||
// if (!`${one.issuer?.and}`.includes('_app')) return
|
||||
// one.issuer.and = [path.resolve(__dirname)]
|
||||
// })
|
||||
|
||||
return config
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue