diff --git a/.changeset/breezy-ants-clap.md b/.changeset/breezy-ants-clap.md new file mode 100644 index 0000000000..1ec79af278 --- /dev/null +++ b/.changeset/breezy-ants-clap.md @@ -0,0 +1,5 @@ +--- +'@ice/rspack-config': patch +--- + +fix: update splitChunk config diff --git a/packages/rspack-config/src/splitChunks.ts b/packages/rspack-config/src/splitChunks.ts index b186bfb769..9d2787ee95 100644 --- a/packages/rspack-config/src/splitChunks.ts +++ b/packages/rspack-config/src/splitChunks.ts @@ -87,8 +87,9 @@ export const getVendorStrategy = (options: Configuration['splitChunks']) => { const getSplitChunks = (_: string, strategy: string | boolean) => { if (strategy === false) { - // Empty splitChunks configuration if strategy is false. - return {}; + // Set minChunks to a large number to disable the splitChunks feature. + // the value of Infinity is not work properly for this version of rspack. + return { minChunks: 100000, cacheGroups: { default: false } }; } else if (typeof strategy === 'string' && ['page-vendors', 'vendors'].includes(strategy)) { const splitChunksOptions = strategy === 'page-vendors' ? { chunks: 'all' } : {}; return getVendorStrategy(splitChunksOptions);