title: how to locally develop angular cli builder
body: <p>I have 2 folders on my machine, one Angular CLI project and one typescript project where I'm developing builders for the Angular CLI architects This is a mono repo and the builders are internal use only that I never plan on publishing. I have tried referencing the builders 4 diffrent ways:</p>
  
  <p>relative:</p>
  
  <pre><code>/* angular.json */
  {
    "projects": {
      "my-cli-proj": {
        "architect": {
          "build": {
            "builder": "relative/path/to/my-builders:my-browser"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>install local module (file:):</p>
  
  <pre><code>/* package.json */
  {
    "devDependencies": {
      "my-builders": "file:relative/path/to/my-builders"
    }
  }
  
  /* angular.json */
  {
    "projects": {
      "my-cli-proj": {
        "architect": {
          "build": {
            "builder": "my-builders:my-browser"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p><s>npm link (the "right" way)</s> (not an option see <a href="https://github.com/angular/angular-cli/issues/13055#issuecomment-442815952" rel="nofollow noreferrer">https://github.com/angular/angular-cli/issues/13055#issuecomment-442815952</a>)</p>
  
  <p>run <code>npm link</code> in the my-builders folder and then <code>npm link my-builders</code> in the angular cli project folder</p>
  
  <pre><code>/* angular.json */
  {
    "projects": {
      "my-cli-proj": {
        "architect": {
          "build": {
            "builder": "my-builders:my-browser"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>npm pack:</p>
  
  <p>run <code>npm pack</code> in the my-builders folder</p>
  
  <pre><code>/* package.json */
  {
    "devDependencies": {
      "my-builders": "file:relative/path/to/my-builders-version.tgz"
    }
  }
  
  /* angular.json */
  {
    "projects": {
      "my-cli-proj": {
        "architect": {
          "build": {
            "builder": "my-builders:my-browser"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>All ways but npm pack produce this misleading error on <code>ng build</code></p>
  
  <blockquote>
    <p>Angular Compiler was detected but it was an instance of the wrong class.
    This likely means you have several @ngtools/webpack packages installed. You can check this with <code>npm ls @ngtools/webpack</code>, and then remove the extra copies.</p>
  </blockquote>
  
  <p>output of <code>npm ls @ngtools/webpack</code></p>
  
  <pre><code>`-- @angular-devkit/build-angular@0.8.3
    `-- @ngtools/webpack@6.2.3
  </code></pre>
  
  <p>Needing to run <code>npm pack</code> for every little change is not reasonable, is there a better way to develop the builder locally? (prefer the builders to be in their own project for separation).</p>
  
  <p>duplication repo <a href="https://github.com/gatimus/builder-development" rel="nofollow noreferrer">https://github.com/gatimus/builder-development</a></p>
  
  <p>Edit:</p>
  
  <p>I also tried </p>
  
  <pre><code>/* angular.json */
  {
    "projects": {
      "my-cli-proj": {
        "architect": {
          "build": {
            "builder": "my-builders:my-browser",
            "options": {
              "preserveSymlinks": true
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>and <code>ng build --preserve-symlink</code>, same results.</p>