How does webpack4 package remove console?

use

new webpack.optimize.UglifyJsPlugin({
     compress: {
         warnings: false,
         drop_debugger: true,
         drop_console: true
     }
)}

prompt that the method has been removed. It is recommended that you use minimize,minimize to remove console.

Mar.29,2022


optimization: {
        minimizer: [
            new TerserPlugin({
                minify: (file, sourceMap) => {
                    // https://github.com/mishoo/UglifyJS2-sharpminify-options
                    const uglifyJsOptions = {
                        /* your `uglify-js` package options */
                        compress:{
                            drop_console:true
                        }
                    };

                    if (sourceMap) {
                        uglifyJsOptions.sourceMap = {
                            content: sourceMap,
                        };
                    }

                    return require('uglify-js').minify(file, uglifyJsOptions);
                },
            }),
        ],
    },

https://webpack.js.org/config...


use the cssnano plug-in
npm I-D @ intervolga/optimize-cssnano-plugin


const optimizeCssnanoPlugin = require('@intervolga/optimize-cssnano-plugin');


module.exports = {
    plugins: [
        new optimizeCssnanoPlugin({
            cssnanoOptions: {
                preset: [
                    'default',
                    {
                        discardComments: {
                            removeAll: true,
                        },
                    }
                ],
            },
        })
    ]
};
< hr >

read the wrong question, this is compressed css, the subject ignore it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31c45-2b611.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31c45-2b611.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?