@jose.donas/vite-plugin-version-manifest
v0.1.3
Published
A Vite plugin to generate a version manifest file with build metadata.
Maintainers
Readme
Vite Plugin Version Manifest
A simple Vite plugin that generates a version manifest file with build and version control information.
✨ Features
- Generates a JSON manifest with useful build-time information.
- Includes project version from
package.json. - Includes info about the runtime (Node.js, Deno, Bun) and its version.
- Includes Git commit hash and branch name.
- Includes build timestamp and duration.
- Zero dependencies.
📦 Installation
npm install @jose.donas/vite-plugin-version-manifest --save-dev
# or
yarn add @jose.donas/vite-plugin-version-manifest --dev
# or
pnpm add @jose.donas/vite-plugin-version-manifest --save-dev🚀 Usage
Add the plugin to your vite.config.ts:
import { defineConfig } from 'vite';
import versionManifest from '@jose.donas/vite-plugin-version-manifest';
export default defineConfig({
plugins: [versionManifest()],
});This will generate a version-manifest.json file in your build output directory.
⚙️ Configuration
You can pass options to the plugin:
import { defineConfig } from 'vite';
import versionManifest from 'vite-plugin-version-manifest';
export default defineConfig({
plugins: [
versionManifest({
// Set to true to log manifest generation details to the console.
verbose: true,
// Customize the output file name.
outFileName: 'my-version-info.json',
}),
],
});| Option | Type | Default | Description |
| ------------- | --------- | ------------------------- | ------------------------------------- |
| verbose | boolean | false | Show logs during manifest generation. |
| outFileName | string | 'version-manifest.json' | Name of the generated manifest file. |
📄 Example Output
The generated version-manifest.json will look like this:
{
"environment": "production",
"versions": {
"package": "1.0.0",
"node": "v20.11.0"
},
"gitInfo": {
"commitHash": "a1b2c3d",
"branch": "main"
},
"buildInfo": {
"time": "2025-10-26T10:00:00.000Z",
"duration": 1234
},
"runtimeInfo": {
"runtime": "Node.js",
"version": "v20.11.0"
}
}🤝 Contributing
Contributions are welcome! Please see the Contributing Guidelines for more details.
📝 License
This project is licensed under the ISC License. See the LICENSE file for details.
