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...


The following options are accepted:

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