Gathering detailed insights and metrics for webpack-plugin-log-version
Gathering detailed insights and metrics for webpack-plugin-log-version
Gathering detailed insights and metrics for webpack-plugin-log-version
Gathering detailed insights and metrics for webpack-plugin-log-version
A webpack plugin that injects a console log statement at the top of a production bundle that includes the project version & git info
npm install webpack-plugin-log-version
Typescript
Module System
Node Version
NPM Version
TypeScript (89.32%)
EJS (6.34%)
JavaScript (4.34%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
48 Commits
3 Watchers
2 Branches
1 Contributors
Updated on Jun 04, 2021
Latest Version
0.6.2
Package Id
webpack-plugin-log-version@0.6.2
Unpacked Size
33.36 kB
Size
21.72 kB
File Count
18
NPM Version
6.14.8
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A simple plugin for logging your project build version into the browser console. The purpose of the plugin is to help keep track of which version of a bundle is deployed where. This may be useful if you deploy different versions of a project in many places.
Note: This plugin is beta software. Please report bugs and contribute suggestions.
This guide assumes you already know how to setup a webpack configuration.
First, install the plugin npm install -D webpack-plugin-log-version
Import the plugin and add it to your config:
1const LogVersionPlugin = require('webpack-plugin-log-version') 2 3module.exports = { 4 entry: './src/js/index.js', 5 output: { 6 filename: 'bundle.js', 7 path: path.resolve(__dirname, 'dist') 8 }, 9 module: { 10 rules: [ 11 { 12 test: /\.js$/, 13 exclude: /(node_modules)/, 14 use: { 15 loader: 'babel-loader', 16 options: { 17 presets: ['@babel/preset-env'] 18 } 19 }, 20 } 21 ] 22 }, 23 plugins: [ 24 new LogVersionPlugin() 25 ] 26}
Run a build of your project and load it in your browser. You should see an output log with the default settings:
You may pass in a configuration object into the plugin to customize the output.
The configuration options and their defaults are as follows:
1declare type PluginOptions = { 2 color: string 3 comment: string 4 deployedBy: boolean | string, 5 git: boolean 6 global: boolean 7 globalName?: string 8 log: boolean 9 name?: string 10 template?: string 11}
color
: Choose a different color for the console.log output. Can be any browser console compatible keyword or HEX value.comment
: Add an optional comment to the end of your logdeployedBy
: Include who built/deployed the bundle. This can be set to a string or true/false. If set to true
along with git: true
, the local git config user.name
is used. Default : false
git
: Enable git features and the project's branch and commit to the log Default: true
global
: Add an object to the global (window) context that contains the log information. Default: false
globalName
: change the key for the global
object. Default: package.name
log
: Enable logging the version information in the console: Default: true
name
: Override the default project name for the version log. Default: package.name
template
: Override the console.log
template for the version information. Uses EJS. Default: See SourceThe plugin uses the following variables if they exist in the template already:
branch
: working directory branchcolor
: log colorcomment
: the optional commentcommit
: the latest commit (HEAD)date
: today's datename
: project nameversion
: project versionYou may change up the template or re-arrange the output as you see fit with the plugin's template
option.
This will generate:1new LogVersionPlugin({ 2 log: false, 3 global: true, 4 globalName: 'myAwesomeLog' 5})
window.myAwesomeLog = {name: package.name, version: package.version, ...etc}
and prevent logging the version out loud in the consoleOutput:1new LogVersionPlugin({ 2 git: false, 3 name: 'Example Bundle', 4 template: '<%= name %> - <%= version %> - <%= date %>' 5})
Example Bundle - 1.2.0 - Wed May 26 2021
1new LogVersionPlugin({ 2 color: 'hotpink', 3 comment: "This bundle is lit! 🔥" 4})
Please leave an issue and explain the problem. Be as detailed as possible. If you wish to contribute feel free to submit pull requests and issues with your features and requests.
If you wish to contribute pull requests, please use the contrib branch
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More