浮声新志

webpack插件篇:MinChunkSizePlugin详解

用途说明

MinChunkSizePlugin (最小值代码块插件)

根据chars大小,如果小于设定的最小值,就合并这些小模块,以减少文件的大小

Merge small chunks that are lower than this min size (in chars). Size is approximated.

  • options.minChunkSize (number) chunks smaller than this number will be merged

webpack.config.js配置

1
new webpack.optimize.MinChunkSizePlugin(options)

案例

1
2