22import type { Chunk , ChunkImport } from ' @rolldown/debug'
33import type { SessionContext } from ' ~~/shared/types/data'
44import type { ModuleGraphLink , ModuleGraphNode } from ' ~/composables/moduleGraph'
5+ import { useRoute } from ' #app/composables/router'
56import { computed , nextTick , unref } from ' vue'
67import { createModuleGraph } from ' ~/composables/moduleGraph'
78
@@ -11,6 +12,7 @@ const props = defineProps<{
1112}>()
1213
1314const chunks = computed (() => props .chunks )
15+ const route = useRoute ()
1416
1517type ChunkInfo = Chunk & {
1618 id: string
@@ -143,7 +145,7 @@ createModuleGraph<ChunkInfo, ChunkImport>({
143145 :modules = " chunks"
144146 >
145147 < template #default = " { node }" >
146- < div flex = " ~ items-center" >
148+ < NuxtLink class = " flex items-center" : to = " { path: route.path, query: { chunk: node.data.module.chunk_id } } " >
147149 < span op50 font - mono w12 > #{{ node .data .module .id }}< / span >
148150 < div flex = " ~ gap-2 items-center" :title = " `Chunk #${node.data.module.id}`" >
149151 < div i - ph - shapes - duotone / >
@@ -155,7 +157,7 @@ createModuleGraph<ChunkInfo, ChunkImport>({
155157 < div i - ph - package - duotone / >
156158 {{ node .data .module .modules .length }}
157159 < / div >
158- < / div >
160+ < / NuxtLink >
159161 < / template >
160162 < / DisplayModuleGraph >
161163< / template >
0 commit comments