Webpack 中文文档(v4.15.1) 目录

webpack HashedModuleIdsPlugin

该插件会根据模块的相对路径生成一个四位数的hash作为模块id, 建议用于生产环境。

--- -------------------------------
  -- -----
--

参数

该插件支持以下参数:

  • hashFunction: 散列算法,默认为 &aposmd5&apos。支持 Node.JS crypto.createHash 的所有功能。
  • hashDigest: 在生成 hash 时使用的编码方式,默认为 &aposbase64&apos。支持 Node.js hash.digest 的所有编码。
  • hashDigestLength: 散列摘要的前缀长度,默认为 4。

用法

下面是使用该插件的例子:

--- -------------------------------
  ------------- ---------
  ----------- ------
  ----------------- --
--

上一篇:ExtractTextWebpackPlugin
下一篇:HotModuleReplacementPlugin