When using HtmlWebpackPlugin to generate the dist/index.html file, we can use the inject option to automatically create <script> tags for the javascript bundle files:
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
// ...
})
And get an index.html file that looks similar to:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
</head>
<body>
<script src="index_bundle.js"></script>
</body>
</html>
For server side constraints, I need to add a query string parameter in the generated script source, to make it look like <script src="index_bundle.js?my-parameter=my-value"></script>. I've been looking at the plugin documentation, but I can't find the way to do it.
Is there any option to modify the generated URLs, by appending an string or replacing with a RegEx?
Thanks in advance!