A Vite plugin that injects git repository information (commit hash, version, branch, last commit datetime) as global constants at build time. Current stable version is 0.0.11, with experimental release cadence. Inspired by git-revision-webpack-plugin, it aims to provide equivalent functionality for Vite projects. Lightweight and zero-config by default, it exposes four globals: GIT_COMMITHASH, GIT_VERSION, GIT_BRANCH, GIT_LASTCOMMITDATETIME. Supports custom variable names, git commands, and lightweight tags. TypeScript types are included.
Verified import paths — ran on the pinned version, not inferred.
Default export only; named import will fail.
Globals are injected at build time via define, not environment variables.
Only visible if version option is true (default true).
Shows plugin setup and usage of injected git globals in a Vue component.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.