title: $(...).DataTable is not a function when using Laravel Mix
body: <p>I struggle using Laravel Mix and DataTables. The issue I have is that when I compile down my .js-files etc., each time I would then visit a page that would execute a jQuery datatable, the follwoing error is thrown:</p>
  
  <p>The error is:</p>
  
  <pre><code>jQuery.Deferred exception: $(...).DataTable is not a function TypeError: $(...).DataTable is not a function
  Uncaught TypeError: $(...).DataTable is not a function
  </code></pre>
  
  <p>From what I understand, <code>$(...).DataTable</code> is not a global variable, but how can I make sure that it is accessible "on a global scope" / within my app?</p>
  
  <p>The following is my setup:</p>
  
  <p>app.js</p>
  
  <pre><code>import jquery from 'jquery/dist/jquery.slim'
  import 'bootstrap-sass'
  import 'datatables.net';
  import dt from 'datatables.net-bs';
  
  window.$ = window.jQuery = jquery;
  </code></pre>
  
  <p>webpack.mix.js</p>
  
  <pre><code>mix
      .js('resources/assets/admin/js/app.js', 'js/')
      .extract([
          'jquery', 'bootstrap-sass', 'datatables.net', 'datatables.net-bs'
      ])
      .autoload({
          jquery: ['$', 'window.jQuery', 'jQuery', 'jquery'],
          DataTable : 'datatables.net-bs'
      })
  </code></pre>
  
  <p>Any idea would be highly appreciated.</p>