Enables Hot Module Replacement, otherwise known as HMR.
Enabling HMR is straightforward and in most cases no options are necessary.
new webpack.HotModuleReplacementPlugin({
// Options...
});
You are reading the documentation for webpack 5, the latest release. Read the webpack 4 documentation here. See the migration guide for upgrading to webpack 5.