webpack打包过滤console.log

在webpack.prod.conf.js里面的plugins里面加上

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

参考链接 https://webpack.js.org/configuration/plugins/

posted @ 2017-09-27 10:40  毛毛雨_Eric  阅读(4304)  评论(0编辑  收藏  举报