vite-plugin-git-revision

Vite plugin that generates VERSION and COMMITHASH files during build based on a local git repository.
21,961 11
Install
npm install vite-plugin-git-revision@1.1.1
Latest Version:1.1.1
License:MIT
Last Updated:May 13, 2024
Links: GitHub  ·  npm
Maintainer: franklinzelo

vite-plugin-pages

npm version monthly downloads

Git version info for Vue 3 applications using Vite

Getting Started

Install:

$ npm install -D vite-plugin-git-revision

Add to your vite.config.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:

// 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

Related Packages

vite-plugin-vue2

Vite plugin for Vue2

1,474,659 618
@koala/yibin-ui

宜宾大脑主题定制

4,077
vite-plugin-vue2-plus

Vite plugin for Vue2

854 618
@yfwz100/vite-plugin-vue2-i18n

The missing vue 2 SFC version of vite plugin for vue-i18n, inspired by the rollu...

147,915 6
@dullar/mercury

Advanced and highly reusable Mobile UI Components built on Vue2 & You can define...

8,553 6

Version History

Version Released License
1.1.1 MIT
0.1.9 MIT
0.1.8 MIT
0.1.7 MIT
0.1.6 MIT