0.1.2 • Published 6 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 --devor npm:
npm install babel-plugin-git-info --save-devUsage
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.jsVia 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.