Dev ToolbarBuilt-in AppsModule Graph

Module Graph

Browse and filter Vite's live module dependency graph — see which files import which, find unused modules, and identify heavy dependency chains.

Last updated:

App ID: dev-toolbar:module-graph

The Module Graph app queries Vite's server-side module graph via RPC and presents it as a filterable, searchable list. Each module entry shows its file extension, URL, and importer count. Click any module to see a detail pane with the full list of files that import it.

Features

  • Live graph — fetches the current state of Vite's module graph on open
  • Full-text search — filter modules by URL or file extension
  • Extension badges — colour-coded by file type (.ts, .tsx, .vue, .css, etc.)
  • Importer count — see at a glance how many modules depend on each file
  • Importer list — click a module to see all files that import it
  • Refresh — re-fetch the graph without reloading the page

Using the Panel

Browsing the Module List

On open the panel fetches all modules currently tracked by Vite and displays them as a scrollable list. Each row shows:

  • Extension badge — colour-coded pill (.ts = blue, .css = purple, .json = yellow, .vue = green, etc.)
  • Module URL — the Vite-resolved path, truncated with monospace font
  • Importer count — a small badge showing N↑ where N is the number of modules that import this one. Modules with no importers are entry points.

Filtering

Type in the search box to filter modules by URL substring or extension. The counter on the right shows filtered / total. The filter is case-insensitive.

Filter modules…   [  42 / 318  ]

Module Detail

Click any module row to open the detail pane on the right:

FieldDescription
URLFull resolved URL
TypeFile extension badge
ImportersNumber of modules that import this one
Imported byList of importer URLs (monospace, one per line)

Click the same row again (or press the button) to close the detail pane.

Refreshing

Click Refresh in the header to re-fetch the module graph from Vite. This is useful after HMR updates that add or remove modules.

Error State

If the RPC call fails (e.g. the Vite server is temporarily unavailable), an error message is shown with a Retry button.

Extension Colour Reference

ExtensionColour
.ts, .tsxBlue
.js, .jsxGreen
.vueEmerald
.cssPurple
.jsonYellow
.svgOrange
OtherGrey

Configuration

Enable via Plugin

The Module Graph app is disabled by default. Enable it in your Vite config:

vite.config.ts
devToolbar({
    apps: {
        moduleGraph: true,
    },
});

Notes

  • The module graph data comes from Vite's server-side ModuleGraph via an RPC call. It reflects modules that have been loaded or imported at least once since the dev server started.
  • Large projects may have hundreds of modules. Use the search filter to narrow results.
  • Virtual modules (those with \0 or ? in their IDs) are included in the list.
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues