浮声新志

webpack插件篇:ExtendedAPIPlugin详解

用途说明

ExtendedAPIPlugin ()

Adds useful free vars to the bundle.

__webpack_hash__ The hash of the compilation available as free var.

WARNING: Don’t combine it with the HotModuleReplacementPlugin. It would break and you don’t need it as the HotModuleReplacementPlugin export the same stuff.

webpack.config.js配置

1
new webpack.ExtendedAPIPlugin()

案例

1
2