What worked for me is to write <script src="https://stackoverflow.com/questions/39066298/bundle.js"> and not <script src="https://stackoverflow.com/questions/39066298/dist/bundle.js"> in my index.html file.
// index.html
<script src="https://stackoverflow.com/questions/39066298/bundle.js"></script> // works
<script src="https://stackoverflow.com/questions/39066298/dist/bundle.js"></script> // doesn't work!
Keeping dist/bundle.js as the output file works perfectly fine if you just build it using webpack. But when using webpack-dev-server, the static file already in the file system continues to be served, and not the latest hot replacement. It seems webpack-dev-server gets confused when it sees dist/bundle.js in the html file and doesn’t hot replace it, even though webpack.config.js is configured to that path.