Skip to content

Commit

Permalink
Add a flag to MergeCssChunksPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Mar 1, 2024
1 parent 8a2460c commit 1290f9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,10 @@ export default async function getBaseWebpackConfig(
new NextFontManifestPlugin({
appDir,
}),
!dev && isClient && new MergeCssChunksPlugin(),
!dev &&
isClient &&
config.experimental.mergeCssChunks &&
new MergeCssChunksPlugin(),
!dev &&
isClient &&
new (require('./webpack/plugins/telemetry-plugin').TelemetryPlugin)(
Expand Down
6 changes: 6 additions & 0 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ export interface ExperimentalConfig {
swrDelta?: SwrDelta
middlewarePrefetch?: 'strict' | 'flexible'
manualClientBasePath?: boolean
/**
* This will enable a plugin that attempts to keep CSS entries below a certain amount
* by merging smaller chunks into larger ones
*/
mergeCssChunks?: boolean
/**
* @deprecated use config.cacheHandler instead
*/
Expand Down Expand Up @@ -904,6 +909,7 @@ export const defaultConfig: NextConfig = {
missingSuspenseWithCSRBailout: true,
optimizeServerReact: false,
useEarlyImport: false,
mergeCssChunks: true,
},
}

Expand Down

0 comments on commit 1290f9c

Please sign in to comment.