const path = require('path')
const webpack = require('webpack')
const mix = require('laravel-mix')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')

mix
  .js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css')

  .sourceMaps()
  .disableNotifications()

if (mix.inProduction()) {
  mix.version()

  mix.extract([
    'vue',
    'vform',
    'axios',
    'vuex',
    'jquery',
    'popper.js',
    'vue-i18n',
    'vue-meta',
    'js-cookie',
    'bootstrap',
    'vue-router',
    'sweetalert2',
    'vuex-router-sync',
    '@fortawesome/fontawesome',
    '@fortawesome/vue-fontawesome'
  ])
}

mix.webpackConfig({
  plugins: [
    // new BundleAnalyzerPlugin(),
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'window.jQuery': 'jquery',
      Popper: ['popper.js', 'default']
    })
  ],
  resolve: {
    alias: {
      '~': path.join(__dirname, './resources/assets/js')
    }
  },
  output: {
    publicPath: '/',
    chunkFilename: 'js/[id].[chunkhash].js'
  }
})

@@ -26,43 +26,8 @@
 h')%0A
-const webpack = require('webpack')%0A
 cons
@@ -693,163 +693,8 @@
 in()
-,%0A    new webpack.ProvidePlugin(%7B%0A      $: 'jquery',%0A      jQuery: 'jquery',%0A      'window.jQuery': 'jquery',%0A      Popper: %5B'popper.js', 'default'%5D%0A    %7D)
 %0A  %5D

Remove ProvidePlugin