title: Angular - debugging multiple libraries/apps with angular CLI
body: <p>When I have more libraries which are dependent on each other, it is very tedious to have the application running and make changes to these libraries. We now use basically multiple ng build/serve processes for each library/app with --watch flag.</p>
  <p>However:</p>
  <ul>
  <li>this does not scale well. When there are 5+ libraries it is unusable.</li>
  <li>the --watch flag does not seem to work very well, e.g. when I have app A with these dependencies A &gt; B &gt; C &gt; D and make change to lib D, C does not pick up the change but the A picks it up.</li>
  <li>sometimes the pipeline brakes and need to be restarted from scratch</li>
  <li>sometimes when I try to kill the node process (with watch) it hangs for minute or more before it exits (it is faster to kill the whole terminal and start from scratch)</li>
  <li>when I want to run multiple apps which depends on the same libraries and make change to a common lib (with watch enabled for one app), the one watched app just fails to build</li>
  </ul>
  <p>I have tried to find solutions, but it boils down to the approach I already use or is only suitable when there is only one (or very few) libraries:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/60473727/angular-build-watch-for-multiple-libraries-and-and-serve-to-another-app">Angular build watch for multiple libraries and and serve to another app</a></li>
  <li><a href="https://stackoverflow.com/questions/65908672/how-to-make-angular-watch-multiple-libraries-for-changes-and-recompile-when-need">How to make Angular watch multiple libraries for changes and recompile when needed</a></li>
  <li><a href="https://stackoverflow.com/questions/59356732/angular-library-and-live-reload/59706221">Angular library and live reload</a></li>
  <li><a href="https://github.com/angular/angular-cli/issues/10643" rel="nofollow noreferrer">https://github.com/angular/angular-cli/issues/10643</a></li>
  </ul>
  <p>Also I know about nrwl/nx: <a href="https://nx.dev/#monorepos" rel="nofollow noreferrer">https://nx.dev/#monorepos</a> and this is probably the right way to go. I just can not believe it is not solved yet in the native cli tooling after some 6 version since the libs were introduced there. Maybe I am just doing something very wrong.</p>
  <p>So the questions are:</p>
  <ul>
  <li>Is there some cli easy and working way how to develop with multiple apps and libs in native angular/cli?</li>
  <li>If not, is there something else/better than nrwl/nx or the ultimate answer to i: Just use nrwl/nx if you have more libs and apps. Period.? If so, it is kind of sad, it is not supported natively in such framework as Angular try to be.</li>
  <li>How the watch is supposed to work, on what it waits exactly? Is it just webpack watch or where are the docs?</li>
  <li>How the dependencies should be resolved automatically between apps and libs (now we use our script to create the dependency tree and start the watch pipeline, but all the problems listed above still holds).</li>
  </ul>