Search code examples
angularnrwlnrwl-nx

How to run nx dep-graph on specific projects only


I am working on a system that is using a mono-repo structure. We are using Nx as a tool to manage the workspace. This workspace consists of several feature-projects that get loaded into a single portal application.

When using Nx, I would like to run a dep-graph analysis on only a single project to show its dependant libraries without showing unrelated projects.

Is this possible with the current nx cli?

I tried running nx dep-graph my-project-name but this still showed the output of the entire workspace


Solution

  • At the moment this functionality is not available for nx dep-graph. This functionality can also be useful for me, that's why I'm waiting for it. Maybe if more people report interest here https://github.com/nrwl/nx/issues/1864 someone will do it :)

    Thanks for reporting this problem


    UPDATE


    Now you can generate deph graph for single project. You can simply add include parameter:

    nx dep-graph --include=project-one

    If you want to see the dependencies of several projects:

    nx dep-graph --include=project-one,project-two

    You can also exclude projects you don't want to see:

    nx dep-graph --include=project-one,project-two --exclude=project-three

    More about dep-graph you can read here