Skip to content

morulus/git-commits-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-commits-loader

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!

Usage

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 by git 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.

Beta

The tool is at the beta stage. Use it carefully.

Author and license

Morulus vladimirmorulus@gmail.com

Under MIT license, 2018

See also

About

Load file git commits info

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published