title: Importing typescript from external node modules
body: <p>I want to split my application into different node modules and have a main module which builds all other modules as well and I want to use typescript with es6 modules.</p>
  
  <p>Here is my planned project structure:</p>
  
  <ul>
  <li>main
  
  <ul>
  <li>node_modules
  
  <ul>
  <li>dep-a</li>
  <li>dep-b</li>
  </ul></li>
  </ul></li>
  <li>framework
  
  <ul>
  <li>interfaces
  
  <ul>
  <li>IComponent.ts</li>
  </ul></li>
  </ul></li>
  <li>dep-a
  
  <ul>
  <li>components
  
  <ul>
  <li>test.ts</li>
  </ul></li>
  <li>node_modules
  
  <ul>
  <li>framework</li>
  </ul></li>
  <li>index.ts</li>
  </ul></li>
  <li>dep-b
  
  <ul>
  <li>node_modules
  
  <ul>
  <li>framework</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>I want to be able to define interfaces in framework which can be consumed in dep-a, dep-b and main.</p>
  
  <p>How do I set up this correctly? Can I compile everything from my main-module? Do I need to create different bundles for framework, dep-a, ... and another typing file? What is the best approach for this?</p>
  
  <p>I already set up some test files and folders and used npm link to link the dependencies and webpack to bundle the files and I am always running into issues with files not being found:</p>
  
  <pre><code>error TS2307: Cannot find module 'framework/interfaces/IComponent'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Module not found: Error: Cannot resolve 'file' or 'directory' ./components/test
  </code></pre>