These snippets were created after reading the following article on how to use webpack to build code bundles for individual JSP pages, and specifically how to get those JSP pages to refer to the correct filename + hash.
https://medium.com/@jsilvax/introducing-webpack-into-an-existing-java-based-web-app-ff53f14d37ec
There was no actual code, but the description of the approach was enough to put something together.
jsilvax just posted some code here: https://medium.com/p/510d859b9f36/responses/show