title: Typescript paths not working in an Express project
body: <p>I am trying to use TypeScript's paths functionality so that I don't need to use relative imports any more.</p>
  <p>Here is my <em>tsconfig.json</em> file:</p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;es5&quot;,
      &quot;module&quot;: &quot;commonjs&quot;,
      &quot;strict&quot;: true,
      &quot;esModuleInterop&quot;: true,
      &quot;outDir&quot;: &quot;./dist&quot;,
      &quot;rootDir&quot;: &quot;.&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;allowSyntheticDefaultImports&quot;: true,
      &quot;resolveJsonModule&quot;: true,
      &quot;baseUrl&quot;: &quot;.&quot;,
      &quot;allowJs&quot;: true,
      &quot;paths&quot;: {
        &quot;*&quot;: [&quot;node_modules/*&quot;, &quot;src/*&quot;],
        &quot;@config/*&quot;: [&quot;src/config/*&quot;],
        &quot;@controllers/*&quot;: [&quot;src/controllers/*&quot;],
        &quot;@middlewares/*&quot;: [&quot;src/middlewares/*&quot;],
        &quot;@models/*&quot;: [&quot;src/models/*&quot;],
        &quot;@routes/*&quot;: [&quot;src/routes/*&quot;],
        &quot;@types/*&quot;: [&quot;src/types/*&quot;],
        &quot;@utils/*&quot;: [&quot;src/utils/*&quot;]
      }
    },
    &quot;include&quot;: [&quot;src/**/*&quot;],
    &quot;exclude&quot;: [&quot;node_modules&quot;, &quot;firebase-config.json&quot;, &quot;webpack.config.js&quot;]
  }
  </code></pre>
  <p>Here is my <em>package.json</em> file:</p>
  <pre><code>{
    &quot;name&quot;: &quot;express-ts-boilerplate&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;description&quot;: &quot;Express Typescript Boilerplate&quot;,
    &quot;main&quot;: &quot;src/server.js&quot;,
    &quot;author&quot;: &quot;Sriram R&quot;,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;NODE_ENV=production node dist/src/app.js&quot;,
      &quot;dev&quot;: &quot;nodemon src/app.ts&quot;,
      &quot;build&quot;: &quot;tsc -p .&quot;,
      &quot;test&quot;: &quot;mocha --exit -r ts-node/register src/tests/*.spec.ts&quot;
    },
    &quot;dependencies&quot;: {
      // Dependencies here
    },
    &quot;devDependencies&quot;: {
      // Dependencies here
    },
  }
  </code></pre>
  <p>So now in one of my files, I try <code>@config/typeConfig</code> but I just get <code>cannot find module</code> error.</p>
  <p>Maybe it's because of <code>nodemon</code> but it didn't work with <code>ts-node</code> too.
  How can I get this to work?</p>