You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-3Lines changed: 43 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,19 +39,59 @@ And a `COMMITHASH` such as:
39
39
7c16d8b1abeced419c14eb9908baeb4229ac0542
40
40
```
41
41
42
+
## Configuration
43
+
44
+
The plugin requires no configuration by default, but it is possible to configure it to support custom git workflows.
45
+
46
+
### `lightweightTags: true`
47
+
42
48
If you need [lightweight tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging#Lightweight-Tags) support, you may turn on `lighweithTags` option in this way:
43
49
44
50
```javascript
45
51
var GitRevisionPlugin =require('git-revision-webpack-plugin')
46
52
47
53
module.exports= {
48
54
plugins: [
49
-
newGitRevisionPlugin({ lightweightTags:true })
55
+
newGitRevisionPlugin({
56
+
lightweightTags:true
57
+
})
58
+
]
59
+
}
60
+
```
61
+
62
+
### `commithashCommand: 'rev-parse HEAD'`
63
+
64
+
To change the default `git` command used to read the value of `COMMITHASH`:
65
+
66
+
```javascript
67
+
var GitRevisionPlugin =require('git-revision-webpack-plugin')
To change the default `git` command used to read the value of `VERSION`:
81
+
82
+
```javascript
83
+
var GitRevisionPlugin =require('git-revision-webpack-plugin')
84
+
85
+
module.exports= {
86
+
plugins: [
87
+
newGitRevisionPlugin({
88
+
versionCommand:'describe --always --tags --dirty'
89
+
})
50
90
]
51
91
}
52
92
```
53
93
54
-
###Path Substitutions
94
+
## Path Substitutions
55
95
56
96
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.
57
97
@@ -69,7 +109,7 @@ module.exports = {
69
109
}
70
110
```
71
111
72
-
### Public API
112
+
##Plugin API
73
113
74
114
The `VERSION` and `COMMITHASH` are also exposed through a public API.
0 commit comments