Skip to content

fix(rolldown): exclude dynamic imports from initial chunks - #591

Draft
hyoban wants to merge 1 commit into
vitejs:mainfrom
hyoban:fix/rolldown-initial-chunks
Draft

hyoban wants to merge 1 commit into
vitejs:mainfrom
hyoban:fix/rolldown-initial-chunks

Conversation

@hyoban

@hyoban hyoban commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Description

Initial JS currently includes chunks reached only through dynamic imports. For example, an entry that statically imports a framework and dynamically imports a chart counts the chart as initial too.

Follow only static imports from user-defined entries, and recompute is_initial when restoring cached snapshots so existing traces receive the correction without rebuilding.

Linked Issues

None.

Additional context

Adds five regression tests covering dynamic-only subtrees, cycles, multiple entries, chunks shared by static and dynamic paths, and older snapshots. The traversal and snapshot tests fail without the fix.

Validation: pnpm lint, pnpm build, and pnpm test --run passed (347 passed, 2 skipped). pnpm typecheck reports the same eight existing Nuxt/Vite plugin type errors on both unmodified 59260bfd and this branch, in the Oxc, Rolldown, and Vite src/modules/rpc.ts files.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@591

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@591

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@591

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@591

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@591

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@591

commit: 380e533

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.

1 participant