title: Laravel Mix: Configure Babel for IE11 compatibility (transformations and polyfills)
body: <p>In a Laravel 6 application with Laravel-Mix 4, and using the Vue preset, I need to compile my JavaScript code to be compatible for IE11. This means adding any polyfills for missing functions, compiling out arrow functions, and so on. Out of the box, this is not done.</p>
  
  <p>My test code in <code>resources/js/app.js</code>:</p>
  
  <pre><code>//require('./bootstrap');
  let test = [1, 2, [3, 4]];
  console.log(
      test.flat().map((x) =&gt; 2*x)
  );
  </code></pre>
  
  <p>With default config, laravel mix does not appear to compile JavaScript code, but only do some formatting. Comments are preserved in the compiled output. </p>
  
  <p>The result of <code>npm run dev</code> is:</p>
  
  <pre><code>       Asset      Size   Chunks             Chunk Names
  /css/app.css   0 bytes  /js/app  [emitted]  /js/app
    /js/app.js  4.95 KiB  /js/app  [emitted]  /js/app
  </code></pre>
  
  <h1>How do I get Laravel-Mix to use Babel to create IE11-compatible source code?</h1>