New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

build-git-version-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-git-version-webpack-plugin

A webpack plugin, add git info version.json to dist

latest
Source
npmnpm
Version
0.0.12
Version published
Maintainers
1
Created
Source

build-git-version-webpack-plugin

A webpack plugin, add git info version.json to dist.

Usage

Install

npm install --save-dev build-git-version-webpack-plugin

Config

Use in Webpack

// webpack.config.js
const { BuildGitVersionWebpackPlugin } = require("build-git-version-webpack-plugin");

module.exports = {
  plugins: [
    new BuildGitVersionWebpackPlugin(),
  ]
}

Use in Vue 2

Working with Webpack

// vue.config.js
const { BuildGitVersionWebpackPlugin } = require("build-git-version-webpack-plugin");

module.exports = {
  configureWebpack: {
    plugins: [
      new BuildGitVersionWebpackPlugin()
    ]
  }
}

or

// vue.config.js
const { BuildGitVersionWebpackPlugin } = require("build-git-version-webpack-plugin");

module.exports = {
  configureWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      config.plugins = [
        ...config.plugins,
        new BuildGitVersionWebpackPlugin()
      ]
    }
  }
}

Use in Vue 3 & Vite & Rollup

recommend rollup-plugin-build-git-version

Use in React

Result

{
    "build": {
        "time": ""
    },
    "git": {
        "branch": "",
        "commit": {
            "id": "",
            "time": "",
            "message": "",
            "author": {
                "name": "",
                "email": ""
            }
        }
    }
}

Keywords

webpack

FAQs

Package last updated on 15 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts