diff --git a/packages/next/next-server/server/config.ts b/packages/next/next-server/server/config.ts index 34ca86e763d7c..f537c5fb21cd7 100644 --- a/packages/next/next-server/server/config.ts +++ b/packages/next/next-server/server/config.ts @@ -99,7 +99,12 @@ function assignDefaults(userConfig: { [key: string]: any }) { } }) - return { ...defaultConfig, ...userConfig } + const result = { ...defaultConfig, ...userConfig } + if (result.experimental && result.experimental.css) { + // The new CSS support requires granular chunks be enabled. + result.experimental.granularChunks = true + } + return result } function normalizeConfig(phase: string, config: any) { diff --git a/test/integration/css/next.config.js b/test/integration/css/next.config.js index 38da3cd3360b3..a00d484fdec00 100644 --- a/test/integration/css/next.config.js +++ b/test/integration/css/next.config.js @@ -3,7 +3,11 @@ module.exports = { // Make sure entries are not getting disposed. maxInactiveAge: 1000 * 60 * 60, }, - experimental: { css: true, granularChunks: true }, + experimental: { + css: true, + // Intentionally set false to ensure we force to true. + granularChunks: false, + }, webpack(cfg) { cfg.devtool = 'source-map' return cfg