I am using webpack-dev-server in a very simple setup.
I've found that even though the server automatically triggers a browser reload when the index.js file changes, it does not trigger a reload when the index.html changes. How can I achieve that?
Here's my setup:
package.json
{
"name": "html-reload",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"build": "node_modules/webpack/bin/webpack.js",
"start": "webpack-dev-server --host 0.0.0.0 --port 8383 --content-base dist"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
}
}
webpack.config.js
module.exports = {
entry: './src/index.js',
output: {
path: 'dist',
filename: 'bundle.js'
}
};
I launch the webpack-dev-server with: npm run start and I point my browser to:
http://localhost:8383/webpack-dev-server/index.html
Every change I made in src/index.js is automatically refreshed in the browser, but not so with changes I make in dist/index.html.