release-version-by-git
v1.0.2
Published
generate public release version from git info. designed in accordance with semantic versioning
Downloads
4
Readme
git release version
About
generate public release version from git info. designed in accordance with semantic versioning
Usage
in vite.config.ts
import { getVersion } from 'release-version-by-git'
import { defineConfig, UserConfig } from 'vite'
export default defineConfig(async (env): Promise<UserConfig> => {
const version = await getVersion()
return {}
})
Rules
- if has git info, then generate version by git info and
package.json
- style:
${major}.${minor}.${patch}-${branch}.${hash}
,major
、minor
、patch
frompkg.version
- style:
- if don't has git info, then copy from
package.json
version. - Support
gitlab CI
, if ingitlab ci build
, prioritize the use of environmental variables