title: Symfony 5 / Encore - Javascript issue
body: <p>I'm a beginner with Symfony and I just finished my first website.
  The website I built is based on Bootstrap and I'm using some jquery for additional js files I made.</p>
  
  <p>I'm having some trouble with Webpack and Encore as neither my Bootstrap JS or jQuery are working.
  I'm having no problem with my SCSS and my homemade js are working (except that they don't get jQuery).</p>
  
  <p>What I did :</p>
  
  <pre><code>npm install --save-dev jquery
  npm install --save-dev popper.js
  npm install --save-dev bootstrap
  </code></pre>
  
  <p>In my <strong>webpack.config.js (Encore)</strong> :</p>
  
  <pre><code>.setOutputPath('public/build/')
  .setPublicPath('/build')
  
  .addEntry('js/ad', './assets/js/ad.js')
  .addStyleEntry('css/app', './assets/css/app.scss')
  
  .splitEntryChunks()
  .enableSingleRuntimeChunk()
  .cleanupOutputBeforeBuild()
  .enableBuildNotifications()
  .enableSourceMaps(!Encore.isProduction())
  .enableVersioning(Encore.isProduction())
  .configureBabelPresetEnv((config) =&gt; {
      config.useBuiltIns = 'usage';
      config.corejs = 3;
  })
  .enableSassLoader()
  </code></pre>
  
  <p>I tried also with and without</p>
  
  <pre><code>.autoProvidejQuery()
  </code></pre>
  
  <p>In my <strong>app.js</strong></p>
  
  <pre><code>import $ from 'jquery';
  
  global.$ = global.jQuery = $;
  
  import 'bootstrap';
  </code></pre>
  
  <p>In my <strong>base.html.twig</strong></p>
  
  <pre><code>&lt;script src="{{ asset('build/js/app.js') }}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>When everything is fine, I'm finally running in the <strong>console</strong></p>
  
  <pre><code>npm run dev
  </code></pre>
  
  <p>or</p>
  
  <pre><code>npm run build
  </code></pre>
  
  <p>After that, my js features are not working. On the pages requiring jQuery, I'm having an error in the console.</p>
  
  <pre><code>Uncaught ReferenceError: jQuery is not defined
      at bootstrap-datepicker.min.js:7
      at bootstrap-datepicker.min.js:7
  book:94 Uncaught ReferenceError: $ is not defined
      at book:94
  </code></pre>
  
  <p>I'm a bit lost and I don't know what to try.
  If I manually add my js files without using Encore, everything works fine.</p>
  
  <p>Thanks in advance for helping !</p>