This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@eloquent/git-version-webpack-plugin

5.0.1 • Public • Published

Git version Webpack plugin

Pull Git version information into Webpack

Current version Build status Test coverage

Usage

Standalone usage

// webpack.config.js

const GitVersionPlugin = require('@eloquent/git-version-webpack-plugin')

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

Usage with html-webpack-plugin

// webpack.config.js

const GitVersionPlugin = require('@eloquent/git-version-webpack-plugin')
const HtmlPlugin = require('html-webpack-plugin')

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

Note that the order of plugins may be significant. That is, HtmlWebpackPlugin may need to appear before GitVersionPlugin. Although this no longer seems to be true under Webpack 5.

Features

  • Adds a single, concise, human-readable VERSION file to the Webpack output.
  • Integrates with html-webpack-plugin, automatically adding a VERSION variable, accessible on the window object.
  • Watches the Git directory for changes when using webpack-dev-server, so that the version always reflects the current Git tag or branch.

Configuration

The following options can be passed to the plugin constructor:

  • path - The path to use for the version file, relative to the output path. Defaults to VERSION.
  • name - The name to use for the version variable, accessible on the window object. Defaults to VERSION.
  • version - Can be used to manually override the version. Useful in the event that Git is not available.

Readme

Keywords

none

Package Sidebar

Install

npm i @eloquent/git-version-webpack-plugin

Weekly Downloads

102

Version

5.0.1

License

MIT

Unpacked Size

8.83 kB

Total Files

4

Last publish

Collaborators

  • eloquent-admin
  • ezzatron