Webpack loader to get information about file git commits.
Ensure that git is installed on machine on which your project builds and project root directory contains .git
folder!
Use as inline query with webpack:
import fileCommits from '!git-commits-loader!./index.js'
By the defaults, you'll get information (author name, author email and date) about initial commit and last commit.
{
initial: {
at: "1522742493",
ae: "ivani@example.com",
an: "Ivan Ivanov"
},
last: {
at: "1523235676",
ae: "petrp@example.com",
an: "Petr Petrov"
}
}
Options:
placeholders
(array) Default: [an
,ae
,at
] Array of placeholders, supported bygit log --pretty=format
;initial
(bool) Default: true Get properties of initial commit;last
(bool) Default: true Get properties of last commit;all
(bool) Default: false Get all commits (heavy);formatSep
(string) Separator of placeholders (by default the separator is quite unique, but you can define your delimiter to avoid collisions)uglify
(bool) Transform code with uglify-js (This is debug only feature)
Custom configuration will be deep mixed with the default configuration, thus shape like { all: false }
will be correct.
The tool is at the beta stage. Use it carefully.
Morulus vladimirmorulus@gmail.com
Under MIT license, 2018
- invoke-loader Resolve and invoke loader and options, the paths to which are specified in the options
- markdown-heading-loader Just get primary heading of markdown document
- markdown-feat-react-loader Use React components directly in markdown