title: Using path mapping in tsconfig with Angular CLI
body: <p>I want to use path-mapping to directly reference a library which sits in the same directory structure as my angular application.</p>
  
  <p>Structure:</p>
  
  <pre><code>mycompany-mylib/
  src/
  tsconfig.json
  </code></pre>
  
  <p>I've added the following to my <code>tsconfig.json</code></p>
  
  <pre><code>{      
    "compilerOptions": {
      ...
      "baseUrl": ".",
      "paths": {
          "@mycompany/mylib": ["mycompany-mylib/lib/src/public_api"],
      }
    }
  }
  </code></pre>
  
  <p>This configuration seems to be correct and Typescript can resolve these paths as I get no errors and full intellisense in Visual Studio Code.</p>
  
  <p>For example:</p>
  
  <pre><code>import { UserClientModule } from '@mycompany/mylib'
  </code></pre>
  
  <p>However when I run <code>ng serve</code> or <code>ng serve --aot</code> I get an error, that the module was not found (My AngularCLI Version is <strong>1.7.4</strong>):</p>
  
  <pre><code>ERROR in src/app/core/components/user-profile/user-profile.component.ts(5,43): error TS2307: Cannot find module '@mycompany/mylib'.
  </code></pre>
  
  <p>This technique should work as there are several blog posts and github issues referencing it. I just can't see what I'm doing wrong. I can fix this in webpack by providing an alias configuraton, but since there is no <code>webpack.config.js</code> in angular cli, I can't do that.</p>