title: How to load chunk with Barba.js & webpack?
body: <p>I'm doing an webpack app with barba.js for the transitions.
  My chunks are not loaded with the navigation's app but just when the app load.</p>
  <p>For exemple, if I open the app directly on this url &quot;localhost:8080/portfolio.html,
  the &quot;portfolio&quot; chunk is read.
  But if I open this page on the &quot;portfolio&quot; menu link (event.preventDefault() on link click), this chunk are not loaded.</p>
  <p>WHY ?</p>
  <pre><code>module.exports = {
      entry: {
          main: path.resolve(__dirname, '../src/script.js'),
          about: path.resolve(__dirname, '../src/js/about.js'),
          portfolioFunction: path.resolve(__dirname, '../src/js/portfolioFunction.js'),
      },
      output:
      {
          filename: 'bundle.[contenthash].js',
          path: path.resolve(__dirname, '../dist')
      },
      optimization: {
          splitChunks: {
            chunks: 'all',
          },
      },
      devtool: 'source-map',
      plugins:
      [
          new CopyWebpackPlugin({
              patterns: [
                  { from: path.resolve(__dirname, '../static') }
              ]
          }),
          new HtmlWebpackPlugin({
              filename: 'index.html',
              template: path.resolve(__dirname, '../src/index.html'),
              chunks: ['main'] 
          }),
          new HtmlWebpackPlugin({
              filename: 'portfolio.html',
              template: path.resolve(__dirname, '../src/portfolio.html'),
              chunks: ['main', 'portfolioFunction'] 
          }),
          new HtmlWebpackPlugin({
              filename: 'about.html',
              template: path.resolve(__dirname, '../src/about.html'),
              chunks: ['main', 'about'], 
          }),
          new HtmlWebpackPlugin({
              filename: 'contact.html',
              template: path.resolve(__dirname, '../src/contact.html'),
              chunks: ['main'] 
          }),
          new MiniCSSExtractPlugin()
      ],
  
  </code></pre>
  <p>Please, I need help !!!
  Thanks</p>