Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soundcloud/git-sha-webpack-plugin
Tag your webpack bundles with a Git SHA linked to the latest commit on that bundle
https://github.com/soundcloud/git-sha-webpack-plugin
Last synced: about 1 month ago
JSON representation
Tag your webpack bundles with a Git SHA linked to the latest commit on that bundle
- Host: GitHub
- URL: https://github.com/soundcloud/git-sha-webpack-plugin
- Owner: soundcloud
- License: mit
- Created: 2014-08-22T16:28:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T21:00:28.000Z (over 1 year ago)
- Last Synced: 2024-09-27T11:42:20.860Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 27
- Watchers: 102
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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 hereoutput: {
filename: '[chunkgitsha].js'
},
plugins: [
new GitSHAPlugin({shaLength: 7})
]
}
```### Options
#### `shaLength`
Allows truncating the SHA to a specific character length. 7 by default.