title: tsc is trying to resolve relative path modules in the wrong folder
body: <p>I'm using <code>npm link</code> to reference a typescript library I'm developing in my test project</p>
  
  <p>Which means that my node_modules looks like this :</p>
  
  <pre><code>node_modules/
  |   myLib/
  |   |   dist/
  |   |   |   subModule/
  |   |   |   |   index.js
  |   |   |   |   index.d.ts
  |   |   |   index.js
  |   |   |   index.d.ts
  |   |   node_modules/
  |   |   src/
  |   |   tsconfig.json
  |   |   package.json
  </code></pre>
  
  <p>Which implies that when I'm trying to reference my library using <code>import X from "myLib"</code> I have to tell the compiler that the sources are in the /dist forlder, not that the root of myLib.</p>
  
  <p>I solved this by adding a "main": "./dist/index.js" in the package.json of myLib</p>
  
  <p>The problem is when I try to import a path relative to myLib
  Like <code>import Y from "myLib/subModule"</code></p>
  
  <p>This time it doesn't work.
  Because instead of looking at  <code>node_modules/myLib/dist/subModule</code> tsc is looking at <code>node_modules/myLib/subModules/dist/</code>  which doesn't exist.</p>
  
  <p>How can I make the compiler to look at the right path for subModules ?</p>