html-build-stamp-plugin
v0.9.5
Published
Webpack plugin to add a commit SHA and build timestamp to a HTML file
Downloads
7
Maintainers
Readme
html-build-stamp-plugin
Webpack plugin to add a Git commit SHA and build timestamp to a HTML file.
Install
npm install --save-dev html-build-stamp-pluginUsage
const HtmlBuildStampPlugin = require('html-build-stamp-plugin');
module.exports = {
// …
plugins: plugins: [
new HtmlBuildStampPlugin({
inputFile: path.resolve(__dirname, 'path', 'to', 'input.html'),
outputFile: path.resolve(__dirname, 'path', 'to', 'output.html')
})
]
}input.html:
<html>
<head>
<meta name="wpb.commit" content="Z">
<meta name="wpb.build" content="Z">
<!-- … -->
</head>
</html>Running Webpack results in output.html:
<html>
<head>
<meta name="wpb.commit" content="e46bd98">
<meta name="wpb.build" content="2025-03-26T20:03:00.000Z">
<!-- … -->
</head>
</html>