I use webpack and html-webpack-plugin to update my index.html file with a generated script package, for example bundle.[hash].js .
Then I need to run webpack-dev-server so that I can load this package into memory and take advantage of the Hot Module replacement feature.
This leads to compilation of the code twice.
However, I would like webpack-dev-server also be able to update index.html with a new bundle.[hash].js , because now I need to run webpack and then webpack-dev-sever . It seems strange to compile twice.
Again, the only reason I run webpack is to get the index.html file with a new package hash. If I could get webpack-dev-server to output the updated index.html to disk, I could refuse the webpack command webpack .
Is it possible? If so, how will the webpack configuration change? My webpack configuration is very long, so I didn’t think it would help post it here.
source share