Webpack - [HMR] Hot Module Replacement is disabled

Ater run npm run dev , http://localhost:8080/ there is nothing display in the browser and the console log show exception Hot Module Replacement is disabled

The solution:

In package.json script section dev config add option : --inline --hot

"scripts": {
  "build": "webpack",
  "dev": "webpack-dev-server --devtool eval --progress --inline --hot --colors --content-base build",
  "test": "echo \"Error: no test specified\" && exit 1"
},

In Webpack.config.js module section add :

plugins: [new webpack.HotModuleReplacementPlugin()]

猜你喜欢

转载自summerkiss7.iteye.com/blog/2343590