const glob = require('glob');
const path = require('path');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');

const entries = {};
glob.sync('./resources/assets/js/*.js').map(entry => {
    const name = entry.match('^.+/(.+?)\\.js$')[1];
    entries[name] = entry;
});

module.exports = {
    mode: process.env.NODE_ENV,
    entry: entries,
    output: {
        path: path.join(__dirname, '/public'),
        filename: './assets/[name].js',
    },
    resolve: {
        alias: {
            vue: 'vue/dist/vue.esm.js',
        },
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                use: [ 'babel-loader' ],
                exclude: /node_modules/,
            },
            {
                test: /\.vue$/,
                use: [ 'vue-loader' ],
            },
            {
                test: /\.(js|vue)$/,
                use: [ 'eslint-loader' ],
                exclude: /node_modules/,
                enforce: 'pre',
            },
            {
                test: /\.scss$/,
                use: [ 'style-loader', 'css-loader', 'postcss-loader', 'sass-loader' ],
            },
            {
                test: /\.(woff2?|ttf|eot|svg|png)(\?v=[\d.]+|\?[\s\S]+)?$/,
                use: [ 'file-loader?name=/assets/[name].[ext]' ],
            },
        ],
    },
    optimization: {
        runtimeChunk: {
            name: 'vendor',
        },
        splitChunks: {
            name: 'vendor',
            chunks: 'initial',
        },
    },
    plugins: [
        new webpack.ProvidePlugin({
            $: 'jquery',
            jQuery: 'jquery',
        }),
        new CleanWebpackPlugin([
            path.join(__dirname, '/public/assets/*'),
        ]),
    ],
};

@@ -3,159 +3,68 @@
 nst 
-glob = require('glob');%0Aconst path = require('path');%0Aconst webpack = require('webpack');%0Aconst CleanWebpackPlugin = require('clean-webpack-plugin
+webpack = require('webpack');%0Aconst path = require('path
 ');%0A
-%0A
 cons
@@ -83,12 +83,23 @@
 %7B%7D;%0A
+require('
 glob
+')
 .syn
@@ -1608,26 +1608,41 @@
 new 
-C
+(require('c
 lean
-W
+-w
 ebpack
-P
+-p
 lugin
+'))
 (%5B%0A 

Update webpack.config.js