Skip to content

vp migrate: Rolldown requires function-form manualChunks (object form causes build failure) #900

@koizuka

Description

@koizuka

Describe the bug

After vp migrate, projects that use object-form manualChunks in their Vite config fail to build because Rolldown does not support the object form.

Warning: Invalid output options (1 issue found)
- For the "manualChunks". Invalid type: Expected Function but received Object.

TypeError: manualChunks is not a function

vp migrate should convert object-form manualChunks to function form, or at minimum warn about this incompatibility.

Before (works with Rollup, fails with Rolldown)

manualChunks: {
  'react': ['react', 'react-dom'],
}

After (works with Rolldown)

manualChunks(id) {
  if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/')) {
    return 'react';
  }
}

Reproduction

  1. Have a Vite project with object-form manualChunks in vite.config.js
  2. Run vp migrate
  3. Run vp build

System Info

vp v0.1.11

Local vite-plus:
  vite-plus  v0.1.11

Tools:
  vite             v8.0.0
  rolldown         v1.0.0-rc.9
  vitest           v4.1.0
  oxfmt            v0.40.0
  oxlint           v1.55.0
  oxlint-tsgolint  v0.16.0
  tsdown           v0.21.2

Environment:
  Version  24.14.0
  Source   lts

Logs

Warning: Invalid output options (1 issue found)
- For the "manualChunks". Invalid type: Expected Function but received Object.

TypeError: manualChunks is not a function
    at name (file:///path/to/node_modules/@voidzero-dev/vite-plus-core/dist/rolldown/shared/rolldown-build-CYoDea9V.mjs:3102:10)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions