Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to disable MergeCssChunksPlugin #62746

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
linkNoTouchStart: z.boolean().optional(),
manualClientBasePath: z.boolean().optional(),
middlewarePrefetch: z.enum(['strict', 'flexible']).optional(),
mergeCssChunks: z.boolean().optional(),
navigationRAF: z.boolean().optional(),
nextScriptWorkers: z.boolean().optional(),
// The critter option is unknown, use z.any() here
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
ztanner marked this conversation as resolved.
Show resolved Hide resolved
/**
* @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
Loading