const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
    entry: './assets/js/app.js',
    output: {
        filename: 'admin.js',
        path: path.resolve(__dirname, 'assets/js'),
    },
    optimization: {
        minimizer: [
            new TerserPlugin({
                extractComments: false, // Prevents admin.js.LICENSE.txt from being generated
            }),
        ],
    },
    performance: {
        hints: false,
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader'
                }
            }
        ]
    }
};
