Skip to content

docs: add experimentalMinChunkSize to migration guide#21892

Open
o-m12a wants to merge 3 commits intovitejs:mainfrom
o-m12a:docs/migration-experimentalMinChunkSize
Open

docs: add experimentalMinChunkSize to migration guide#21892
o-m12a wants to merge 3 commits intovitejs:mainfrom
o-m12a:docs/migration-experimentalMinChunkSize

Conversation

@o-m12a
Copy link
Contributor

@o-m12a o-m12a commented Mar 16, 2026

This is a docs-only change with no runtime impact.

Summary

Add build.rollupOptions.output.experimentalMinChunkSize to the v7 → v8 migration guide, noting its removal and that there is no direct equivalent in Rolldown. Points to the codeSplitting option as the general area for controlling chunk splitting.

Placed after the manualChunks section, as both are Rollup output → Rolldown codeSplitting migrations.

What I confirmed

  • pnpm run docs-build passes
  • The new section renders correctly in the built docs
  • The link to the Rolldown codeSplitting API reference resolves correctly
  • codeSplitting.minSize without groups has no effect (Rolldown emits a warning)
  • codeSplitting with groups is not a direct 1:1 replacement for experimentalMinChunkSize

Fixes #21844

@Perdolique
Copy link

Tried the suggested fix on Vite 8.0.1, and it doesn't work. 2000 or even 200_000 generates over 600 chunks instead of 300 in Vite v7.3.1. Any minSize value doesn't affect the output.

import { defineConfig } from 'vite';

const defaultConfig = defineConfig({
  build: {
    sourcemap: 'hidden',
    assetsInlineLimit: 0,

    rolldownOptions: {
      output: {
        codeSplitting: {
          minSize: 200_000
        }
      }
    }
    
    // rollupOptions: {
    //   output: {
    //     experimentalMinChunkSize: 2000
    //   }
    // }
  }
});

export default defaultConfig;

minSize only takes effect when groups are defined, so it is not
a direct replacement for experimentalMinChunkSize.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@o-m12a
Copy link
Contributor Author

o-m12a commented Mar 20, 2026

@Perdolique Thanks for testing this! You're right — I've confirmed that codeSplitting.minSize only takes effect when groups are defined. Rolldown itself emits a warning:

Manual code splitting options (minSize) specified without groups. These options have no effect without groups

This means codeSplitting.minSize is not a direct 1:1 replacement for experimentalMinChunkSize. I've updated the PR in 9a44f38 to clarify this and point to the codeSplitting docs more broadly, including the groups option.

See also: rolldown/rolldown#4932

@Perdolique
Copy link

@o-m12a I guess it's not even close to being a replacement. The purpose of the experimentalMinChunkSize is automatically joining small chunks together without additional effort (600 chunks to 300 in my case). I don't see how it might be possible by using groups. 🤔

@o-m12a
Copy link
Contributor Author

o-m12a commented Mar 20, 2026

@Perdolique That's a fair point — codeSplitting with groups is fundamentally different from experimentalMinChunkSize, which automatically merges small chunks bottom-up. I've updated the PR in 122ad81 to state that there is no direct equivalent in Rolldown, and instead point to codeSplitting as the general area for controlling chunk splitting.

For tracking automatic chunk merging support in Rolldown, see rolldown/rolldown#4788.

@Perdolique
Copy link

Ahh, alright. Then it's probably the feature, not the documentation bug, from my perspective. It's only the blocker at the moment for switching us from Vite v7 to v8. I'll track the rolldown issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't find output.experimentalMinChunkSize in the v7 -> v8 migration guide

2 participants