es6 - 编译后让注释不可见,对编译后的变量和方法进行重命名

访问量: 43

参考:https://stackoverflow.com/questions/38210802/how-to-remove-comments-from-transpiled-code-using-babel-cli

去掉注释:  

新增 .babelrc文件, 

{
  "comments": false
}

删掉console.info / console.log:

修改  /build/webpack.prod.conf.js

     new UglifyJsPlugin({
       uglifyOptions: {
         compress: {
-          warnings: false
+          warnings: false,
+          drop_console: true,
         }
       },
-      sourceMap: config.build.productionSourceMap,

+      sourceMap: false,
       parallel: true
     }),

订阅/RSS Feed

Subscribe

分类/category