title: Import module from root path in TypeScript
body: <p>Let's suppose I've a project, and its main source directory is:</p>
  
  <pre><code>C:\product\src
  </code></pre>
  
  <p>Based on this directory, every import path would be relative to it. I.e., suppose:</p>
  
  <pre><code>// Current script: C:\product\src\com\name\product\blah.ts
  
  import { thing } from '/com/name/product/thing';
  </code></pre>
  
  <p>same as:</p>
  
  <pre><code>// Current script: C:\product\src\com\name\product\blah.ts
  
  import { thing } from '../../../com/name/product/thing';
  </code></pre>
  
  <p>My entry compilation file would be at:</p>
  
  <pre><code>C:\product\src
  </code></pre>
  
  <p>for instance. So, is there a way to specify this such entry path (<code>C:\product\src</code>, for example) at the compiler options? I need to specify this in the <code>tsconfig.json</code> file, because I'll use webpack.</p>
  
  <p>I've tried my above example, but TypeScript says the requested module cannot be found:</p>
  
  <pre><code>// Current script: A.ts
  
  import { B } from '/com/B';
  
  
  // Current script: B.ts
  
  export const B = 0;
  </code></pre>
  
  <p>My tsconfig.json file (inside another project, but both similiar):</p>
  
  <pre><code>{
      "compilerOptions": {
          "module": "commonjs",
          "noImplicitReturns": true,
          "noImplicitThis": true,
          "noUnusedLocals": true,
          "preserveConstEnums": true,
          "removeComments": true,
          "sourceMap": true,
          "strictNullChecks": true,
          "target": "ES6"
      },
  
      "include": [
          "./src/**/*.ts",
          "./src/**/*.d.ts"
      ]
  }
  </code></pre>