@@ -53,6 +53,7 @@ It is also possible to use [path substitutions](https://webpack.js.org/configura
53
53
- ` [git-revision-version] `
54
54
- ` [git-revision-hash] `
55
55
- ` [git-revision-branch] ` (only [ when branch is enabled] ( #branch-false ) )
56
+ - ` [git-revision-last-commit-datetime] `
56
57
57
58
Example:
58
59
@@ -67,7 +68,7 @@ module.exports = {
67
68
68
69
## Plugin API
69
70
70
- The ` VERSION ` , ` COMMITHASH ` and ` BRANCH ` are also exposed through a public API.
71
+ The ` VERSION ` , ` COMMITHASH ` , ` LASTCOMMITDATETIME ` and ` BRANCH ` are also exposed through a public API.
71
72
72
73
Example using the [ DefinePlugin] ( https://webpack.js.org/plugins/define-plugin/#usage ) :
73
74
@@ -80,6 +81,7 @@ module.exports = {
80
81
' VERSION' : JSON .stringify (gitRevisionPlugin .version ()),
81
82
' COMMITHASH' : JSON .stringify (gitRevisionPlugin .commithash ()),
82
83
' BRANCH' : JSON .stringify (gitRevisionPlugin .branch ()),
84
+ ' LASTCOMMITDATETIME' : JSON .stringify (gitRevisionPlugin .lastcommitdatetime ()),
83
85
})
84
86
]
85
87
}
@@ -169,6 +171,22 @@ module.exports = {
169
171
}
170
172
```
171
173
174
+ ### ` lastCommitDateTimeCommand: 'log -1 --format=%cI' `
175
+
176
+ To change the default ` git ` command used to read the value of ` LASTCOMMITDATETIME ` :
177
+
178
+ ``` javascript
179
+ var GitRevisionPlugin = require (' git-revision-webpack-plugin' )
180
+
181
+ module .exports = {
182
+ plugins: [
183
+ new GitRevisionPlugin ({
184
+ branchCommand: ' log -1 --format=%ci'
185
+ })
186
+ ]
187
+ }
188
+ ```
189
+
172
190
## Outdated webpack
173
191
174
192
If your project is ** not using webpack version 4 or greater** , you will need to install an older version of this package:
0 commit comments