title: VS Code: "Cannot find module" from root path
body: <p>I cannot seem to solve a module import issue with Visual Studio Code:</p>
  
  <p><a href="https://i.stack.imgur.com/33tzW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/33tzW.png" alt="Cannot find module"></a></p>
  
  <p>I've a setup a <a href="https://github.com/brianmhunt/bug-reports/tree/vscode-ts-module-import" rel="nofollow noreferrer">sample repo to illustrate</a> this problem, with a directory structure like this:</p>
  
  <pre><code>➜ tree -I node_modules
  .
  ├── README.md
  ├── packages
  │   ├── jsx
  │   │   └── jsx.jsx
  │   ├── tjs
  │   │   └── tjs.js
  │   ├── tscript
  │   │   └── tscript.js
  │   └── tsx
  │       └── tsx.tsx
  ├── src
  │   ├── entry.ts
  │   └── localjs.js
  └── tsconfig.json
  </code></pre>
  
  <p>I'd like to have this setup work with <a href="https://babeljs.io/docs/en/babel-preset-typescript" rel="nofollow noreferrer">babel-typescript</a>, but my investigation indicates that the problem seems to be intrinsic to VSCode, so I've left it out of the sample.</p>
  
  <p>I've tried all the permutations of the <code>paths</code> for <code>tsconfig.json</code> that I've seen i.e.</p>
  
  <pre><code>    "paths": {
        "*": [
          "*",
          "packages/*",
          "packages/*/index.tsx",
          "packages/*/index.jsx",
          "packages/*/index.js"
        ],
        "$1": [
          "packages/$1/$1"
        ],
        "~/*": [
          "packages/*"
        ],
        "~/$1": [
          "packages/$1/$1"
        ],
        "*/$1": [
          "*/$1/$1",
          "packages/$1/$1",
          "*/packages/$1/$1"
        ]
      }
  </code></pre>
  
  <p>The <a href="https://www.typescriptlang.org/docs/handbook/module-resolution.html#tracing-module-resolution" rel="nofollow noreferrer">handbook</a> doesn't offer much insight.</p>