I have polymer webComponents that are bundled by webpack and consumed from another domain. These webComponets are JavaScript and get bundled into a single file with a hash.
Example:
output: {
path: OUTPUT_PATH,
filename: '[name].[chunkhash:8].js'
}
Normally, I would use HtmlWebpackPlugin (with a template) to generate the appropriate script tag (a tag that targets the bundle with the hash). However, there is no html file in this case. The consuming HTML is in another application and I only serve js.
Any advice on how to serve this bundle with the changing hash filename?
My current attempt is a small javascript 'loader' file that is never cached and will load the bundled/hash file. I don't know how to get the hash name into this 'loader' file. I need something similar to HtmlWebpackPlugin that will work with a js file. Or an entirely different approach.
Any ideas?