Glob the pattern/s (comma separated), parse the content, add to webpack compilation assets, and prefix compilation hash to webpack entries.
//webpack.config.js
entry: {
"app.js": "src/app.js",
"app.css": "src/app.css",
},
plugins: [
new ContentVersioning({
src: "./src",
pattern: "**/*.html",
}),
],
<!-- src/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="version" content="[commit]">
<title>Advertiser | Bringhub</title>
<link rel="stylesheet"
type="text/css"
href="[hash].app.css">
<script defer
src="[hash].app.js"></script>
</head>
</html>
src/app.js is output to dist/j281ajdhk12.app.js
src/index.html output to dist/index.html with the rendered hashes and git commit version