Webpack add plug-ins, add copyright webpack.BannerPlugin does not work?

const webpack = require("webpack");
module.exports={
    devtool: "eval-source-map",
    entry:__dirname+"/app/main.js",//
    output: {
        path:__dirname+"/public",//
        filename: "bundle.js"//
    },
    devServer: {
        contentBase: "./public",//
        historyApiFallback: true,//
        inline: true//
    },
    module: {
        rules: [
            {
            test:/(\.jsx|\.js)$/,
            use:{
                loader:"babel-loader",
            },
            exclude:/node_modules/
            },
            {
                test: /\.css$/,
                use: [
                    {
                        loader: "style-loader"
                    }, {
                        loader: "css-loader",
                        options: {
                            modules: true, // css modules
                            localIdentName: "[name]__[local]--[hash:base64:5]" // css
                        }
                    },{
                        loader: "postcss-loader"
                    }
                ]
            }
        ]
    },
    plugins: [
        new webpack.BannerPlugin("")
    ],
}

the configuration is as follows, but without the copyright plug-in npm, how to modify it?

Sep.16,2021

Master, Hello ~
there should be a plug-in to delete your generated comment code. Check your .babelrc configuration file for relevant comment attributes, such as comments: true. , you can take a look at the related articles, Portal


Hello, have you solved it? I also encountered this problem

.
Menu