HotModuleReplacementPlugin

HotModuleReplacementPlugin

Enables Hot Module Replacement, otherwise known as HMR.

HMR should never be used in production.

Basic Usage

Enabling HMR is easy and in most cases no options are necessary.

new webpack.HotModuleReplacementPlugin({
  // Options...
})

Options

The following options are accepted:

  • multiStep (boolean): If true, the plugin will build in two steps -- first compiling the hot update chunks, and then the remaining normal assets.
  • fullBuildTimeout (number): The delay between the two steps when multiStep is enabled.
  • requestTimeout (number): The timeout used for manifest download (since webpack 3.0.0)
These options are experimental and may be deprecated. As mentioned above, they are typically not necessary and including a new webpack.HotModuleReplacementPlugin() is enough.

Further Reading

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/plugins/hot-module-replacement-plugin

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部