0

I've been learning webpack-dev-server recently, the webpack documentation tells me that when I try to implement HMR(hot-moudle-replacement),I should use devServer.hot to "Enable webpack's Hot Module Replacement feature",just like this:

module.exports = {
   /*other thing ...*/
  hot:true
}

and the documentation also tells me that "Note that you must also include a new webpack.HotModuleReplacementPlugin() to fully enable HMR" just like this:

 plugins:[
   new webpack.HotModuleReplacementPlugin()
 ]

but! even I don't used the two methods mentioned above, the HMR still work!!!for CSS,JS event JSX

I am very confused

pengHuWan
  • 3
  • 1

1 Answers1

0

First, make sure you're not confusing hot reloading with live reloading.

Secondly, check your webpack-dev-server options. Do you have --inline --hot included?

Finally, take a look at your Babel presets. I'm using babel-preset-react-hmre which results in the following DevTools Console output.

Tran Situ
  • 111
  • 5