@jjggddb/webpack-version-plugin
v1.0.12
Published
Webpack plugin that emits version.json with git metadata during build.
Maintainers
Readme
webpack-version-plugin
Webpack plugin that emits a version.json file during build.
Install
npm i webpack-version-plugin --save-devUsage
const VersionJsonPlugin = require("webpack-version-plugin");
module.exports = {
// ...other webpack config
plugins: [
new VersionJsonPlugin({
filename: "version.json",
extra: {
appName: "my-app",
},
}),
],
};Output example
{
"version": "a1b2c3d",
"hash": "a1b2c3d4e5f6...",
"shortHash": "a1b2c3d",
"branch": "main",
"tag": "v1.2.3",
"buildTime": "2026-03-17T01:31:35.659Z",
"compilationHash": "f0f5..."
}Options
filename(string): output filename, defaultversion.jsoncwd(string): directory used for git commands, defaultprocess.cwd()extra(object): extra fields merged into output JSON
