title: I would like to enable inside function import in type script how should I do it?
body: <p>I use typescript and typeorm, have fellow error for command:</p>
  
  <pre><code>typeorm migration:run
  </code></pre>
  
  <p>errors:</p>
  
  <pre><code>F:\personalprojects\MyProject\src\entity\User.ts:1
  (function (exports, require, module, __filename, __dirname) { import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
                                                                       ^
  
  SyntaxError: Unexpected token {
  at new Script (vm.js:79:7)
  at createScript (vm.js:251:10)
  at Object.runInThisContext (vm.js:303:10)
  at Module._compile (internal/modules/cjs/loader.js:657:28)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
  at Module.load (internal/modules/cjs/loader.js:599:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  at Function.Module._load (internal/modules/cjs/loader.js:530:3)
  at Module.require (internal/modules/cjs/loader.js:637:17)
  at require (internal/modules/cjs/helpers.js:20:18)
  </code></pre>
  
  <p>my tsconfig.json is:</p>
  
  <pre><code>{
  "compilerOptions": {
    "lib": [
       "es5",
       "es6"
    ],
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "./build",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true
  }
  }
  </code></pre>
  
  <p>My User.ts is:</p>
  
  <pre><code>import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
  
  @Entity()
  export class User {
  
  @PrimaryGeneratedColumn()
  id: number;
  
  @Column()
  firstName: string;
  
  @Column()
  lastName: string;
  
  @Column()
  age: number;
  
  }
  </code></pre>
  
  <p>how to enable inside the function can import something?</p>