简体   繁体   中英

Cannot get Hot Module working in Atom

I've installed everything what I need (webpack, webpack-server), confingured my webpack.config.js and package.json, still the localhost:8080 does not render on safe. Neither does it render on localhost:8080/webpack-dev-server/index.html on safe. On manual reload it renders perfectly.

package.json :

在此处输入图片说明

webpack.config.js 在此处输入图片说明

npm run dev executes successfully but I also have to reload the page manually after I make some changes in my index.html which is in the parent folder. Also, I always have to run webpack manually in my cmd when I change my .js file. Hot loading should also take care of this if I'm correct.

Let me also add that the app is recompiling when I run CTRL+s but it doesn't actually recompile.

在此处输入图片说明

I had a similar problem with live reloading on changes. Try to change link to bundle.js in your index.html <script src="/bundle.js"></script> If you look in console output after npm start there will be same like webpack output is served from / Dev-server takes bundle from root directory of your project, not from /js/bundle.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM