# git-sha-webpack-plugin

> Tag your webpack bundles with a Git SHA linked to the latest commit on that bundle

Latest version **0.0.6** (published 2015-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install git-sha-webpack-plugin
pnpm add git-sha-webpack-plugin
yarn add git-sha-webpack-plugin
bun add git-sha-webpack-plugin
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2015-10-01 |
| First published | 2014-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Jason Anderson |
| Maintainers | diurnalist |

## Links

- npm: https://www.npmjs.com/package/git-sha-webpack-plugin
- Repository: https://github.com/diurnalist/git-sha-webpack-plugin
- Issues: https://github.com/diurnalist/git-sha-webpack-plugin/issues
- npm.io page: https://npm.io/package/git-sha-webpack-plugin

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^0.9.0
- [git-bundle-sha](https://npm.io/package/git-bundle-sha.md) ^0.0.2

## Recent versions

- 0.0.6 (latest) — 2015-10-01
- 0.0.5 — 2015-10-01
- 0.0.4 — 2014-10-21
- 0.0.3 — 2014-10-02
- 0.0.2 — 2014-08-28
- 0.0.1 — 2014-08-22

## README

# git-sha-webpack-plugin

Allows tagging a webpack bundle or chunk with the Git SHA of the latest commit affecting that bundle. Useful for when you want to use long-term caching of your bundles, but want to tie the hash to something real and traceable.

## Usage

Install via npm:

```shell
npm install git-sha-webpack-plugin
```

And then require for use in webpack:

```javascript
// in webpack.config.js (or similar)
var GitSHAPlugin = require('git-sha-webpack-plugin');

module.exports = {
  
  // your config values here

  output: {
    filename: '[chunkgitsha].js'
  },
  plugins: [
    new GitSHAPlugin({shaLength: 7})
  ]
}
```

### Options

#### `shaLength`

Allows truncating the SHA to a specific character length. 7 by default.

---
_Source: https://npm.io/package/git-sha-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
