title: Angular 9 application build fails when working with linked libraries
body: <p>I am developing an application and a bunch of libraries to be used in the application. All are recently upgraded to Angular 9. The libraries are configured to build without ivy and the application is configured to build with ivy, which is as per the upgrade guidelines. The local development process I used to follow is as below -</p>
  <ol>
  <li>Build the library and application with --watch.</li>
  <li>Make changes in the library. After library build succeeds, copy dist/my-lib and paste it in the application's node_modules folder(this triggers the application build).</li>
  </ol>
  <p>This worked till Angular 8 and below but with Angular 9 the application build errors out saying:
  <strong>ERROR in Tried to overwrite path/node_modules/my-lib/lib/services/payment.service.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.</strong></p>
  <p>So, now I have to additionally do the following -</p>
  <ol>
  <li>Stop the application build.</li>
  <li>Delete the lib from application's node_modules and then copy paste the new one.</li>
  <li>Start the application again.</li>
  </ol>
  <p>The angular docs says to use npm link <a href="https://angular.io/guide/creating-libraries#linked-libraries" rel="nofollow noreferrer">https://angular.io/guide/creating-libraries#linked-libraries</a>. But I am not able to get the meaning of :</p>
  <blockquote>
  <p>the library's package.json configuration points at the correct entry points. For example, main should point at a JavaScript file, not a TypeScript file.</p>
  </blockquote>
  <p>I tried npm link but that doesn't trigger the application build and my changes are not reflected.
  I would like to know how to resolve the npm link issue or if there is a better way to work with libs and apps together.</p>
  <p>My lib's package.json looks like this (Since I am working on a client application, I am only posting the package.json structure):</p>
  <pre><code>{
    &quot;name&quot;: &quot;my-lib&quot;,
    &quot;version&quot;: &quot;1.2.0&quot;,
    &quot;description&quot;: &quot;description&quot;,
    &quot;repository&quot;: {
      &quot;url&quot;: &quot;http://private-nexus-url&quot;
    },
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;build-ci&quot;: &quot;npm run test-headless &amp;&amp; npm run sonar &amp;&amp; npm run publish&quot;,
      &quot;test-headless&quot;: &quot;ng test --watch=false --browsers=ChromeHeadlessNoSandbox --code-coverage&quot;,
      &quot;sonar&quot;: &quot;sonar-scanner&quot;,
      &quot;test&quot;: &quot;ng test --code-coverage&quot;,
      &quot;lint&quot;: &quot;ng lint&quot;,
      &quot;e2e&quot;: &quot;ng e2e&quot;,
      &quot;build-lib&quot;: &quot;ng build --prod my-lib&quot;,
      &quot;publish&quot;: &quot;npm run build-lib &amp;&amp; cd dist/my-lib &amp;&amp; npm publish&quot;,
      &quot;postinstall&quot;: &quot;ngcc&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@angular/animations&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/common&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/compiler&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/core&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/forms&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/platform-browser&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;^9.1.6&quot;,
      &quot;@angular/router&quot;: &quot;^9.1.6&quot;,
      ...
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;^0.901.5&quot;,
      &quot;@angular-devkit/build-ng-packagr&quot;: &quot;~0.901.5&quot;,
      &quot;@angular/cli&quot;: &quot;~9.1.5&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;~9.1.6&quot;,
      &quot;@angular/language-service&quot;: &quot;~9.1.6&quot;,
      ...
    },
    &quot;husky&quot;: {
      &quot;hooks&quot;: {
        &quot;pre-commit&quot;: &quot;lint-staged&quot;
      }
    },
    &quot;lint-staged&quot;: {
      &quot;*.ts&quot;: [
        &quot;prettier --write&quot;,
        &quot;git add&quot;
      ]
    }
  }
  </code></pre>