title: How to use lodash-es in typescript correctly?
body: <p>I need to use <code>lodash-es</code> in my typescript project, but I can't configure it correctly, it always reports errors like <code>SyntaxError: Unexpected identifier</code></p>
  
  <p><strong>hello.ts</strong></p>
  
  <pre><code>import upperCase from 'lodash-es/upperCase'
  
  console.log('Hello ' + upperCase('typescript') + '!');
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "scripts": {
      "demo": "ts-node hello.ts"
    },
    "dependencies": {
      "lodash-es": "4.17.11"
    },
    "devDependencies": {
      "@types/lodash-es": "4.17.1",
      "ts-node": "7.0.0",
      "typescript": "3.0.1"
    }
  }
  </code></pre>
  
  <p><strong>tsconfig.json</strong></p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es6",
      "module": "commonjs"
    }
  }
  </code></pre>
  
  <p>When run <code>ts-node hello.ts</code>, it reports error like:</p>
  
  <pre><code>/typescript-use-lodash-es-demo/node_modules/lodash-es/upperCase.js:1
      (function (exports, require, module, __filename, __dirname) { import createCompounder from './_createCompounder.js';
                                                                           ^^^^^^^^^^^^^^^^
  
      SyntaxError: Unexpected identifier
          at new Script (vm.js:79:7)
          at createScript (vm.js:251:10)
  </code></pre>
  
  <p>I've also setup a small demo for this issue, you can clone and try it if you need: <a href="https://github.com/freewind-demos/typescript-use-lodash-es-demo" rel="noreferrer">https://github.com/freewind-demos/typescript-use-lodash-es-demo</a></p>
  
  <p>A related question is to use lodash-es with babel: <a href="https://stackoverflow.com/questions/52851818/how-to-configure-babel-correctly-to-use-lodash-es">How to configure babel correctly to use lodash-es?</a>. Since I'm not sure they have exactly the same reason, so I asked for typescript here</p>