So I'm trying to run webpack to compile my code, but when I run npx webpack --config webpack.config.js I get the following error:
ERROR in main.js from Terser
Invalid assignment [main.js:78674,15]
There's not much to go off of, I'm not even sure where to look. Does anyone have any ideas what might be causing this?
Here's my webpack config:
const path = require('path');
module.exports = {
    entry: './server.js',
    target: "node",
    output: {
        filename: 'main.js',
        path: path.resolve(__dirname, 'dist'),
        publicPath: "/public/"
    },
    module:{
        rules: [
            {
                test: /\.m?js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env'],
                        plugins: ['@babel/plugin-syntax-dynamic-import']
                    }
                }
            }
        ]
    },
    resolve: {
        alias: {
            'express-handlebars': 'handlebars/dist/handlebars.js'
        }
    }
};
Thanks!