Inspecting Dependencies

Bit makes it easy to understand the dependencies within your project. Let's explore how to inspect and visualize them.

Listing component dependenceies

To view the dependencies of a component, use the bit show command. This command lists the direct, peer, and development dependencies of a component. For instance, to see the dependencies of the button component:

$bit
Copiedcopy
See command synopsis

Finding component usages

Run the following to review your component's full dependency graph:

$bit
Copiedcopy
See command synopsis

The example above describes all the paths to the lodash packages. You can configure the depth for the search using the --depth flag.

Listing dependents

To find out which components depend on a specific component, use the following command:

$bit
Copiedcopy
See command synopsis

The example above will list all components that depend on the login component.

Dependency graph visualization

Bit Cloud provides a visual representation of your component dependencies, making it easy to understand the relationships between them. To access this visualization, navigate to the Dependencies tab on the component or scope pages in Bit Cloud. You can also access the component page locally by running bit start and then clicking on the component you want to explore.

Visual dependencies graph

This visual graph helps you quickly identify dependencies, dependents, and potential issues in your project's structure.