{"id":20707,"library":"webpack-auto-inject-version","title":"webpack-auto-inject-version","description":"Webpack plugin that automatically injects version from package.json into bundle files as a comment block, replaces custom tags (e.g., [AIV]{version}[/AIV]) in HTML/CSS/JS, and optionally auto-increments the package version via webpack env flags (--env.major, --env.minor, --env.patch). Current stable version 1.2.2. Simple configuration with sensible defaults, all features enabled out of the box. Supports customization of comment format, date format, and tag regex. Limited maintenance; no major updates since 2019.","status":"maintenance","version":"1.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/radswiat/webpack-auto-inject-version","tags":["javascript"],"install":[{"cmd":"npm install webpack-auto-inject-version","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-auto-inject-version","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-auto-inject-version","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for webpack plugin","package":"webpack","optional":false}],"imports":[{"note":"This package does not provide ESM exports; use CommonJS require.","wrong":"import WebpackAutoInject from 'webpack-auto-inject-version';","symbol":"WebpackAutoInject","correct":"const WebpackAutoInject = require('webpack-auto-inject-version');"}],"quickstart":{"code":"// webpack.config.js\nconst WebpackAutoInject = require('webpack-auto-inject-version');\n\nmodule.exports = {\n  // ... webpack config\n  plugins: [\n    new WebpackAutoInject({\n      SHORT: 'CUSTOM',\n      SILENT: false,\n      PACKAGE_JSON_PATH: './package.json',\n      PACKAGE_JSON_INDENT: 4,\n      components: {\n        AutoIncreaseVersion: false,\n        InjectAsComment: true,\n        InjectByTag: true\n      },\n      componentsOptions: {\n        InjectAsComment: {\n          tag: 'Version: {version} - {date}',\n          dateFormat: 'h:MM:ss TT',\n          multiLineCommentType: false\n        },\n        InjectByTag: {\n          fileRegex: /\\.+/,\n          AIVTagRegexp: /(\\[AIV])(([a-zA-Z{} ,:;!()_@\"'\\\\\\/])+)(\\[\\/AIV])/g,\n          dateFormat: 'h:MM:ss TT'\n        }\n      }\n    })\n  ]\n};","lang":"javascript","description":"Configures webpack-auto-inject-version plugin in webpack.config.js with all options, injecting version as comment and replacing [AIV] tags."},"warnings":[{"fix":"Set runInWatchMode to false (default) to avoid unintended version bumps during development.","message":"AutoIncreaseVersion in watch mode will increment version on every rebuild if runInWatchMode is true (default false).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider migrating to alternative plugins like 'webpack-version-plugin' or use webpack.DefinePlugin with process.env.npm_package_version.","message":"Package has not been updated since 2019; may not work with latest webpack 5+ without adjustments.","severity":"deprecated","affected_versions":">=1.2.2"},{"fix":"Set PACKAGE_JSON_INDENT to match your package.json indent (usually 2) to avoid unwanted changes.","message":"PACKAGE_JSON_INDENT default is 2, but example shows 4; mismatched indent may cause version file reformatting.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install webpack-auto-inject-version --save-dev' and use require('webpack-auto-inject-version').","cause":"Missing npm install or incorrect import path.","error":"Module not found: Error: Can't resolve 'webpack-auto-inject-version'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}