title: Cannot find module - typescript path alias error
body: <p>On compile i get error that i can't fix :/</p>
  
  <pre><code>index.ts:2:19 - error TS2307: Cannot find module '@shared'
  </code></pre>
  
  <p>Any ideas why is it?</p>
  
  <p>Project structure:</p>
  
  <p><a href="https://i.stack.imgur.com/OldVq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OldVq.png" alt="enter image description here"></a></p>
  
  <p>tsconfig.json:</p>
  
  <pre><code>{
    "compilerOptions": {
      "outDir": "../../build/backend",
    },
    "extends": "../../configs/tsconfig.base.json",
    "references": [
      {
        "path": "../shared"
      }
    ],
    "paths": {
      "@shared": [
        "../shared/index"
      ]
    }
  }
  </code></pre>
  
  <p>backend/index.ts:</p>
  
  <pre><code>import 'module-alias/register'
  import { x } from '@shared'
  
  console.log(x)
  </code></pre>
  
  <p>shared/index.ts:</p>
  
  <pre><code>export const x = 'this is shared index'
  </code></pre>