Skip to content

Commit

Permalink
Fix Legacy CSS Modules on the Server (#8970)
Browse files Browse the repository at this point in the history
CSS Modules run their loader on the server, so we need to patch both variants of the webpack configuration.
  • Loading branch information
Timer authored Oct 5, 2019
1 parent e9b2e25 commit e2ca0ac
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down

0 comments on commit e2ca0ac

Please sign in to comment.