/html-webpack-git-revision-plugin

Webpack plugin that generates the latest git commit hash within html meta tag for versioning build.

Primary LanguageJavaScript

html-webpack-git-revision-plugin

npm

Webpack plugin can generate the latest git commit hash within html meta tag, which is very helpful when checking whether the deployment meets the expectations. It requires html-webpack-plugin.

Installation

npm install html-webpack-git-revision-plugin --save-dev

Usage

const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackGitRevisionPlugin = require('html-webpack-git-revision-plugin');

module.exports = {
  plugins: [
    new HtmlPlugin(),
    new HtmlWebpackGitRevisionPlugin()
  ]
}

Output:

<html>
    <head>
        <meta name="git-revision" content="0dc85118e7a1139d5dab943b7eee529c7be06d9c">
    </head>
</html>

FAQ