How to build minified and uncompressed bundle with webpack?

前端 未结 14 1124
囚心锁ツ
囚心锁ツ 2020-11-29 14:52

Here\'s my webpack.config.js

var webpack = require(\"webpack\");

module.exports = {

  entry: \"./entry.js\",
  devtool: \"source-map\",
  outp         


        
14条回答
  •  [愿得一人]
    2020-11-29 15:20

    To add another answer, the flag -p (short for --optimize-minimize) will enable the UglifyJS with default arguments.

    You won't get a minified and raw bundle out of a single run or generate differently named bundles so the -p flag may not meet your use case.

    Conversely the -d option is short for --debug --devtool sourcemap --output-pathinfo

    My webpack.config.js omits devtool, debug, pathinfo, and the minmize plugin in favor of these two flags.

提交回复
热议问题