A Rollup plugin that generates a version.json file containing git information (branch, commit id, time, message, author) and build time during the bundle process. Current version 0.0.9 is stable but likely early-stage; release cadence is unknown. Key differentiator: provides structured git metadata directly in the output, useful for CI/CD pipelines and runtime version display. Supports Node >=16 and pnpm 8.x. Ships TypeScript types. Note that the plugin uses require() in its own example, but Rollup encourages ESM imports.
npm install rollup-plugin-build-git-versionVerified import paths — ran on the pinned version, not inferred.
This example shows how to integrate the plugin into a Rollup configuration, generating version.json in the output directory.
Use import { buildGitVersion } from 'rollup-plugin-build-git-version'.Consider using before/after hooks or custom plugin to merge if needed.
Update Node to >=16, or use an alternative if stuck on older Node.
Use Rollup's manual output or another plugin to move the file post-build.
npm install --save-dev rollup-plugin-build-git-version
Use import { buildGitVersion } from 'rollup-plugin-build-git-version'.Switch to import syntax or use dynamic import().
No dependency data recorded yet.