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) {
|
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({
|
config.module.rules.push({
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
use: ['@svgr/webpack'],
|
use: ['@svgr/webpack'],
|
||||||
})
|
})
|
||||||
config.module.rules[2].oneOf.forEach((one) => {
|
|
||||||
if (!`${one.issuer?.and}`.includes('_app')) return
|
// Disable CSS modules
|
||||||
one.issuer.and = [path.resolve(__dirname)]
|
// config.module.rules[2].oneOf.forEach((one) => {
|
||||||
})
|
// if (!`${one.issuer?.and}`.includes('_app')) return
|
||||||
|
// one.issuer.and = [path.resolve(__dirname)]
|
||||||
|
// })
|
||||||
|
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue