在WebPack 2中关闭uglify

时间:2017-01-14 13:53:59

标签: bundling-and-minification uglifyjs webpack-2

--production模式下运行时,有没有办法从webpack 2跳过uglify js插件?

1 个答案:

答案 0 :(得分:8)

实测值: https://github.com/webpack/webpack/blob/9734d00d8bf0d306654f40e9b34b60db9c7fdda1/bin/config-optimist.js#L47

optimist
  .boolean("p")
  .describe(
    "p", 
    "shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\""
  )

临时解决方法将运行webpack --define process.env.NODE_ENV=\"production\"而不是webpack -p