2

I have developed a library "A" made of several modules ("x", "y", "z") with the following folders structure:

project
 + apps
 - libs
   + A
   - B
     - x
       - src
         - lib
            + components
            + services
              x.module.ts
     + y
     + z
   + C

I can build each module of the library with the following command: nx build @A/x

Does exist a command to build the whole "A"?

I have found nx run-many --target=build --projects=A:x,A:y,A:z but I'm afraid is not applicable in my case due the file and folder structure I have given to my library.

Generally speaking, what is the best practice in case of modular library or a library that have a grouping folder like mine?

smartmouse
  • 13,912
  • 34
  • 100
  • 166
  • Is there a natural root/principle/core library? If so you can add the others to this on via [implicitDependancies](https://nx.dev/more-concepts/how-project-graph-is-built#how-the-project-graph-is-built) and building the root/principle/core library will build the others if you have `"targetDefaults": { "build": { "dependsOn": ["^build"], ... },` inside `nx.json`. Here `^build` means the dependents libraries – Andrew Allen Mar 29 '23 at 01:43

0 Answers0