title: js require import .ts file instead of .js
body: <p>I have a index.ts and a User.ts file</p>
  
  <p>the index.ts file imports User:</p>
  
  <pre><code>import User from './User'
  </code></pre>
  
  <p>I then use tsc to transpile the ts files to js files and then I run the index file:</p>
  
  <p>tsc index.ts
  node index.js</p>
  
  <p>Unfortunately this gives me this error:</p>
  
  <pre><code>(node:1672) UnhandledPromiseRejectionWarning: C:\temp\dev\models\User.ts:1
  (function (exports, require, module, __filename, __dirname) { import {Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn} from "typeorm"
                                                                ^^^^^^
  
  SyntaxError: Unexpected token import
  </code></pre>
  
  <p>So it seems that my import statement <code>import User from './User'</code> is transpiled to <code>User = require('./User')</code> and still imports the User.ts file instead of the User.js</p>