vite-plugin-git-version
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

vite-plugin-git-version

A Vite plugin that focuses on generating packaging information for Git projects.

version license

English | 中文

It is better to use with watone tools power builder

Microsoft Store Download

Use Documentation

Get the version information from package.json, then automatically put the version file version.json in your project dist folder when packaging.

// package.json
{
  // ...
  "name": "vite-plugin-git-version",
  "version": "1.0.0"
}
// dist/version.json
{
  "name": "vite-plugin-git-version",
  "version": "1.0.0",
  "branch": "(HEAD -> main, origin/main, origin/HEAD)",
  "hash": "3e85fdd2e0aeac7685e3d20da16ff979440cbcb8",
  "commitUser": "xkloveme (xkloveme@gmail.com)",
  "commitContent": "chore: 更新README和package.json中的依赖信息\n更新版本\nchore: release v1.0.4",
  "time": "2024-08-09 22:13:11"
}

Install

pnpm add vite-plugin-git-version
yarn add vite-plugin-git-version
npm i vite-plugin-git-version

Add plugin to your vite.config.ts or vite.config.js:

// vite.config.ts
import { defineConfig } from 'vite'
import VersionGitPlugin from 'vite-plugin-git-version'

export default defineConfig({
  plugins: [
    VersionGitPlugin(),
  ],
})

License

MIT License © 2024 xkloveme

Package Sidebar

Install

npm i vite-plugin-git-version

Weekly Downloads

6

Version

1.0.7

License

MIT

Unpacked Size

12.6 kB

Total Files

9

Last publish

Collaborators

  • xkloveme