vue打包关闭console.log

在build webpack.prod.conf.js

new UglifyJsPlugin({
        uglifyOptions: {
        compress: {
        warnings: false,
        drop_debugger: true, 
        drop_console: true // 打包之后关闭console.log
     }
    },
    sourceMap: config.build.productionSourceMap,
    parallel: true

原文:https://www.bianchengquan.com/article/256008.html

你可能感兴趣的:(vue打包关闭console.log)