From b78ee3c45d99484d8680ef539f397cfe4246a5f2 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sat, 10 Oct 2026 22:27:29 +0800 Subject: [PATCH] fix(rolldown): keep filtered-out importers from hiding modules in the module graph --- packages/rolldown/src/app/components/modules/Graph.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/rolldown/src/app/components/modules/Graph.vue b/packages/rolldown/src/app/components/modules/Graph.vue index f8b14ebb0..d9e874ade 100644 --- a/packages/rolldown/src/app/components/modules/Graph.vue +++ b/packages/rolldown/src/app/components/modules/Graph.vue @@ -26,7 +26,10 @@ createModuleGraph({ generateGraph: (options) => { const { isFirstCalculateGraph, spacing, tree, hierarchy, collapsedNodes, modulesMap, nodes, links, nodesMap, linksMap, width, height, childToParentMap, focusOn } = options const rootModules = computed(() => { - return modules.value.filter(x => x.importers.length === 0) + const roots = modules.value.filter((module) => { + return !module.importers.some(importer => modulesMap.value.has(importer)) + }) + return roots.length ? roots : modules.value }) function registerChildParent(moduleId: string, parentId: string) {