0.1.2 • Published 5 years ago
babel-plugin-git-info v0.1.2
babel-plugin-git-info
A babel plugin that generate and insert git information into the files during compilation.
Installation
Use yarn:
yarn add babel-plugin-git-info --dev
or npm:
npm install babel-plugin-git-info --save-dev
Usage
Via .babelrc (Recommended)
.babelrc
Without options:
{
"plugins": [
"babel-plugin-git-info"
]
}
With options:
{
"plugins": [
["babel-plugin-git-info", { "hashLength": 10 } ]
]
}
Via CLI
babel --plugins babel-plugin-git-info script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["babel-plugin-git-info"]
});
Options
hashLength
number
, defaults to -1
, which means to remain the full length of commit hash.