title: How to build with babel and node 14?
body: <p>Im trying to build my project with babel and target node 14.15.4</p>
  <p>My .babelrc is like this</p>
  <pre><code>{
    &quot;presets&quot;: [
      [
        &quot;@babel/preset-env&quot;,
        {
          &quot;targets&quot;: {
            &quot;node&quot;: true
          }
        }
      ]
    ]
  }
  </code></pre>
  <p>So i expected babel output will be compatible with current node. Unfortunately babel output keeps using <code>require</code> syntax instead of <code>import</code> so can't be run with node 14, that throws error</p>
  <pre><code>require(&quot;./server.js&quot;);
  ^
  
  ReferenceError: require is not defined
      at file:///Users/grzegorz/Projects/charts/server/dist/index.js:3:1
      at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
      at async Loader.import (internal/modules/esm/loader.js:166:24)
      at async Object.loadESM (internal/process/esm_loader.js:68:5)
  </code></pre>
  <p>Any idea what im doing wrong?</p>