0.2.3 • Published 5 years ago

git-commits-loader v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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