Build a static site generator with Webpack

I’d like to generate html contents using javascript template literals, and output static html files on Webpack compile time. I also need a development server with hot module replacement capabilities that works with html, css, and js files.

The problem is that webpack-dev-server doesn’t work when I change views javascript files to generate html.

The issue and solution are explained in detail in this stackoverflow post.