5.0.1 • Published 3 years ago

@eloquent/git-version-webpack-plugin v5.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.
5.0.1

3 years ago

4.0.0

3 years ago

5.0.0

3 years ago

3.0.0

4 years ago

2.1.0

5 years ago

2.0.2

5 years ago

1.0.1

5 years ago

0.3.1

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago