Fix Legacy CSS Modules on the Server (#8970)

CSS Modules run their loader on the server, so we need to patch both variants of the webpack configuration.
This commit is contained in:
Joe Haddad 2019-10-04 22:53:14 -04:00 committed by GitHub
parent e9b2e25c44
commit e2ca0ac0e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -922,11 +922,7 @@ export default async function getBaseWebpackConfig(
}
// Patch `@zeit/next-sass` and `@zeit/next-less` compatibility
if (
!isServer &&
webpackConfig.module &&
Array.isArray(webpackConfig.module.rules)
) {
if (webpackConfig.module && Array.isArray(webpackConfig.module.rules)) {
;[].forEach.call(webpackConfig.module.rules, function(
rule: webpack.RuleSetRule
) {