Repository navigation
fix(rolldown): keep filtered-out importers from hiding modules in the module graph - #610
Merged
Merged
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
IWANABETHATGUY
marked this pull request as draft
October 10, 2026 14:29
IWANABETHATGUY
marked this pull request as ready for review
October 10, 2026 15:57
webfansplz
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Rolldown module graph picked its roots with
importers.length === 0. That checks importers across the whole build, but the graph only gets the modules left after the file-type and package filters. A module whose importers were all filtered out was neither a root nor anyone's child, so it disappeared. When no remaining module had zero importers, the graph was empty.Roots are now the modules with no importer left in the filtered list, falling back to all modules when every one has an importer. This is the rule the Vite module graph already uses (
packages/vite/src/app/components/modules/Graph.vue). The unfiltered graph is unchanged.Screenshots
These screenshots show Rolldown DevTools inspecting its own frontend: the client build of the Nuxt app in
packages/rolldown(entrynuxt/dist/app/entry.js).pnpm buildin this repo builds it with Rolldown and records the session inpackages/rolldown/node_modules/.rolldown/. "Before" ismainat 89a7090, "after" is this PR.To reproduce: run
pnpm build, thenpnpm -C packages/rolldown run dev, open the session fornuxt/dist/app/entry.js, switch Modules to Graph, and apply the filter. The dev server currently rejects the client with "Not authorized by the devframe server" despiteclientAuth: falsein its Nuxt config, so I started it withVITE_DEVTOOLS_DISABLE_CLIENT_AUTH=true.CSS filter: empty graph before, 4 CSS modules after.
Package filter (
floating-vue): empty graph before, both modules after.Vue filter: before,
app.vueand the modules reachable only through it are missing. The lazy-loaded pages still show because they have no static importer. After,app.vueis a root.