Socket
Socket
Sign inDemoInstall

git-revision-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-revision-webpack-plugin - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

2

package.json
{
"name": "git-revision-webpack-plugin",
"version": "2.5.0",
"version": "2.5.1",
"description": "Simple webpack plugin that generates VERSION and COMMITHASH files during build",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -49,2 +49,41 @@ # Git Revision Webpack Plugin

## Path Substitutions
It is also possible to use [path substituitions](http://webpack.github.io/docs/configuration.html#output-filename) on build to get the revision, version or branch as part of output paths.
- `[git-revision-version]`
- `[git-revision-hash]`
- `[git-revision-branch]` (only [when branch is enabled](#branch-false))
Example:
```javascript
module.exports = {
output: {
publicPath: 'http://my-fancy-cdn.com/[git-revision-version]/',
filename: '[name]-[git-revision-hash].js'
}
}
```
## Plugin API
The `VERSION`, `COMMITHASH` and `BRANCH` are also exposed through a public API.
Example using the [DefinePlugin](http://webpack.github.io/docs/list-of-plugins.html#defineplugin):
```javascript
var gitRevisionPlugin = new GitRevisionPlugin()
module.exports = {
plugins: [
new DefinePlugin({
'VERSION': JSON.stringify(gitRevisionPlugin.version()),
'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
})
]
}
```
## Configuration

@@ -133,40 +172,1 @@

```
## Path Substitutions
It is also possible to use two [path substituitions](http://webpack.github.io/docs/configuration.html#output-filename) on build to get either the revision or version as part of output paths.
- `[git-revision-version]`
- `[git-revision-hash]`
- `[git-revision-branch]` (only [when branch is enabled](#branch-false))
Example:
```javascript
module.exports = {
output: {
publicPath: 'http://my-fancy-cdn.com/[git-revision-version]/',
filename: '[name]-[git-revision-hash].js'
}
}
```
## Plugin API
The `VERSION`, `COMMITHASH` and `BRANCH` are also exposed through a public API.
Example using the [DefinePlugin](http://webpack.github.io/docs/list-of-plugins.html#defineplugin):
```javascript
var gitRevisionPlugin = new GitRevisionPlugin()
module.exports = {
plugins: [
new DefinePlugin({
'VERSION': JSON.stringify(gitRevisionPlugin.version()),
'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
})
]
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc