Inline mode in HTML does not work
See original GitHub issueI’m using v1.14.1. Webpack creates my js/bundle.js and copies a bunch of HTML files, including a root index.html using file-loader. As startup command I use
webpack-dev-server --inline --hot --content-base build/
Everything works fine and I can access the site at http://localhost:8080/. Now when I make a change in the original HTML file (in the folder from where file-loader copied it), this does not trigger an automatic refresh. But it does trigger a rebuild. So when I manually refresh the page I can see the change.
It looks like something goes wrong with the automatic refresh. The documentation of automatic refresh only says that “There is also the option to add a reference to the webpack-dev-server client script to the HTML page”.
Is the referenced http://localhost:8080/webpack-dev-server.js supposed to be injected by the server? But even if I add it manually to index.html, the automatic refresh does not work.
What am I doing wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)

Top Related StackOverflow Question
Check your loader tests. If you do something too permissive like
{test: /^(?!.*\.(jsx?|css|html)$)/i, loader: 'file-loader'}, something in the socket reloader chain will accidentally run through file-loader and reloading will break without an explicit error.Some more insight after playing around. When starting
webpack-dev-serverwithHMR works fine, but automatic refresh for HTML pages does not work. When I remove the
--hotoption and start webpack withautomatic refresh for HTML pages works fine and also refresh for JavaScript. Obviously for JavaScript it’s not a hot reload.
Any idea why
--hotbreaks the HTML auto refresh and is there a way to get both auto refresh for HTML and HMR working, @sokra?