title: Angular - include .ts file from local custom npm module (installed)
body: <p><strong>question</strong>: how to let Angular look inside the <code>node_modules</code> folder instead of the 'custom directory defined in package.json' when including files from a custom npm-module. (see package.json below) </p>
  
  <hr>
  
  <p>In my project i have 2 folders</p>
  
  <ul>
  <li>root
  
  <ul>
  <li>angular
  
  <ul>
  <li>src</li>
  <li>package.json</li>
  </ul></li>
  <li>shared (npm module)
  
  <ul>
  <li>src</li>
  <li>package.json</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>within the directory of <strong><em>angular</em></strong>, i install my custom npm module through the normal <code>npm install</code>. here is the package.json file</p>
  
  <pre><code> {
    "name": "angular",
    "dependencies": {
      "shared-module": "file:../shared-module"
    }
  </code></pre>
  
  <p>i can see its installed correctly by checking the node_modules folder of the <strong><em>angular</em></strong> directory</p>
  
  <ul>
  <li>root
  
  <ul>
  <li>angular
  
  <ul>
  <li>node_modules
  
  <ul>
  <li>shared-module
  
  <ul>
  <li>src</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>then when I include a file from the <strong><em>shared-module</em></strong> in the <strong><em>angular</em></strong> project</p>
  
  <pre><code>import 'shared-module/src/util/countries';
  </code></pre>
  
  <p>it doesn't seem to look inside the angular->node_modules folder, but instead keeps going to the 'original' directory of the custom npm module ..</p>
  
  <blockquote>
    <p>ERROR in ../shared-module/src/util/countries.ts
    is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.</p>
  </blockquote>
  
  <p>if I update the tsconfig.json to include the 'original' directory, it works.. </p>
  
  <pre><code>"include": [
    "./src/**/*.ts",
    "../shared-modules//src/**/*.ts"
  ]
  </code></pre>
  
  <p>But then there is no real point adding it to the package.json with (unless you publish the module)</p>
  
  <pre><code>"shared-module": "file:../shared-module"
  </code></pre>
  
  <p>So it feels like I am missing some settings maybe? Thanks in advance</p>
  
  <hr>
  
  <p>edit: it seems <strong><em>NPM 5</em></strong> creates a symlink when using it like this </p>
  
  <pre><code>"shared-modules": "file:../shared-module"
  </code></pre>
  
  <hr>
  
  <p>edit2: <strong><em>preserveSymlinks</em></strong> doesn't seem to do anything (<a href="https://www.typescriptlang.org/docs/handbook/compiler-options.html" rel="nofollow noreferrer">https://www.typescriptlang.org/docs/handbook/compiler-options.html</a>)</p>
  
  <p>anyway around that behavior and just <strong><em>really install</em></strong> the package?</p>