1.0.3 • Published 5 years ago

git-commit-info-webpack-plugin v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

The reason for the output file being JSON is to allow more versatility in regards to which language/frameworks are capable of reading it.

npm install --save git-commit-info-webpack-plugin

To run with default options, modify your Webpack config file(s):

const GitCommitInfoWebpackPlugin = require("git-commit-info-webpack-plugin");

// ------

module.exports = {
  module: {
    // ------
  },
  plugins: [
    new GitCommitInfoWebpackPlugin()
  ]
}

Additionally, options may be specified:

new GitCommitInfoWebpackPlugin({
  pathToFile: './',
  filename: 'git.json'
})
NameTypeDescription
pathToFile{String}Path to folder that will contain the output file. This folder must already exist during Webpack's "afterEmit" compiler hook.
filename{String}Name of the JSON output file.

A JSON file will be created with the following key-value pairs:

KeyDescriptionExample
branch_nameCurrent Git branch namefeature/my_new_feature
last_commit_dateDatetime of latest commit2019-02-06T06:10:03.000Z
last_commit_authorAuthor of latest commiteli.wendlick
last_commit_hashFull hash of latest commit154e57fca206014c30ccf6f520f0e918cc1f4256
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago