title: Jest setup "SyntaxError: Unexpected token export"
body: <p>I'm implementing tests into an existing project that currently has no tests. My tests are failing to compile <code>node_modules/</code> imports.</p>
  <pre><code>/Users/me/myproject/node_modules/lodash-es/lodash.js:10
  export { default as add } from './add.js';
  ^^^^^^
  SyntaxError: Unexpected token export
    
    at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:320:12)
    at Object.&lt;anonymous&gt; (app/reducers/kind_reducer.js:2:43)
    at Object.&lt;anonymous&gt; (app/reducers/index.js:12:47)
  </code></pre>
  <p>The workaround I've found is to 'whitelist' <code>node_modules</code> in package.json jest config like this:</p>
  <pre><code>&quot;jest&quot;: {
      &quot;transformIgnorePatterns&quot;: [
        &quot;!node_modules/&quot;
      ]
    }
  </code></pre>
  <p>This seems like a hack because it takes over 1 minute to run a simple test that imports <code>node_modules/lodash-es/lodash.js</code>.</p>