File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1897,7 +1897,10 @@ export default async function getBaseWebpackConfig(
18971897 new NextFontManifestPlugin ( {
18981898 appDir,
18991899 } ) ,
1900- ! dev && isClient && new MergeCssChunksPlugin ( ) ,
1900+ ! dev &&
1901+ isClient &&
1902+ config . experimental . mergeCssChunks &&
1903+ new MergeCssChunksPlugin ( ) ,
19011904 ! dev &&
19021905 isClient &&
19031906 new ( require ( './webpack/plugins/telemetry-plugin' ) . TelemetryPlugin ) (
Original file line number Diff line number Diff line change @@ -276,6 +276,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
276276 linkNoTouchStart : z . boolean ( ) . optional ( ) ,
277277 manualClientBasePath : z . boolean ( ) . optional ( ) ,
278278 middlewarePrefetch : z . enum ( [ 'strict' , 'flexible' ] ) . optional ( ) ,
279+ mergeCssChunks : z . boolean ( ) . optional ( ) ,
279280 navigationRAF : z . boolean ( ) . optional ( ) ,
280281 nextScriptWorkers : z . boolean ( ) . optional ( ) ,
281282 // The critter option is unknown, use z.any() here
Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ export interface ExperimentalConfig {
193193 swrDelta ?: SwrDelta
194194 middlewarePrefetch ?: 'strict' | 'flexible'
195195 manualClientBasePath ?: boolean
196+ /**
197+ * This will enable a plugin that attempts to keep CSS entries below a certain amount
198+ * by merging smaller chunks into larger ones
199+ */
200+ mergeCssChunks ?: boolean
196201 /**
197202 * @deprecated use config.cacheHandler instead
198203 */
@@ -904,6 +909,7 @@ export const defaultConfig: NextConfig = {
904909 missingSuspenseWithCSRBailout : true ,
905910 optimizeServerReact : false ,
906911 useEarlyImport : false ,
912+ mergeCssChunks : true ,
907913 } ,
908914}
909915
You can’t perform that action at this time.
0 commit comments