# vite-plugin-git-revision

> Vite plugin that generates VERSION and COMMITHASH files during build based on a local git repository.

Latest version **0.1.9** (published 2021-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-plugin-git-revision
pnpm add vite-plugin-git-revision
yarn add vite-plugin-git-revision
bun add vite-plugin-git-revision
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2021-05-10 |
| First published | 2021-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | qduld |
| Maintainers | franklinzelo |
| Keywords | vite, vue2 |

## Links

- npm: https://www.npmjs.com/package/vite-plugin-git-revision
- Repository: https://github.com/qduld/vite-plugin-git-revision
- Homepage: https://github.com/qduld/vite-plugin-git-revision/tree/master/#readme
- Issues: https://github.com/qduld/vite-plugin-git-revision/issues
- npm.io page: https://npm.io/package/vite-plugin-git-revision

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.1.9 (latest) — 2021-05-10
- 0.1.8 — 2021-04-22
- 0.1.7 — 2021-04-21
- 0.1.6 — 2021-04-21
- 0.1.5 — 2021-04-21
- 0.1.4 — 2021-04-21
- 0.1.3 — 2021-04-21
- 0.1.2 — 2021-04-21
- 1.1.1 — 2021-04-21

## README

# vite-plugin-pages

[![npm version](https://badgen.net/npm/v/vite-plugin-git-revision)](https://www.npmjs.com/package/vite-plugin-git-revision)
[![monthly downloads](https://badgen.net/npm/dm/vite-plugin-git-revision)](https://www.npmjs.com/package/vite-plugin-git-revision)

> Git version info for Vue 3 applications using [Vite](https://github.com/vitejs/vite)

## Getting Started

Install:

```bash
$ npm install -D vite-plugin-git-revision
```

Add to your `vite.config.js`:

```js
import Vue from '@vitejs/plugin-vue';
import GitRevision from 'vite-plugin-git-revision';

export default {
  plugins: [
    Vue(), 
    GitRevision()
  ],
};
```
## Configuration

To use custom configuration, pass your options to Pages when instantiating the plugin:

```js
// vite.config.js
import GitRevision from 'vite-plugin-git-revision';

export default {
  plugins: [
    GitRevision({
      lightweightTags:false,
      branch:false,
      versionCommand:'describe --tags --long --dirty --always',
      commithashCommand:'',
      branchCommand:'',
    }),
  ],
};
```

### lightweightTags

- **Type:** `boolean`
- **Default:** `false`

lightweight tags support.

### branch

- **Type:** `boolean`
- **Default:** `false`

branch tags support.

### versionCommand

- **Type:** `string`
- **Default:** `describe --always`

change the default git command used to read the value of VERSION.

### commithashCommand

- **Type:** `string`
- **Default:** `rev-parse HEAD`

change the default git command used to read the value of COMMITHASH.

### branchCommand

- **Type:** `string`
- **Default:** `rev-parse --abbrev-ref HEAD`

change the default git command used to read the value of BRANCH.

## License

MIT License © 2021 [qduld](https://github.com/qduld)

---
_Source: https://npm.io/package/vite-plugin-git-revision · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
