webpack.config.js

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

module.exports = {
    entry: './main.js',
    output: {
        path: path.resolve('./dist'),
        filename: 'merge.min.js',
    },
    mode: 'production',
    target: 'node',
    node: {
        global: true,
        __filename: false,
        __dirname: false,
    },
    module: {
        rules: [],
    },
    // optimization: {
    //     minimize: true,
    //     minimizer: [
    //         new TerserPlugin({
    //             extractComments: false, // 不将注释提取到单独的文件中
    //         }),
    //     ],
    // },
};