Skip to content

Commit 80f3491

Browse files
2 parents ee86354 + 4ae869f commit 80f3491

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ It is also possible to use [path substitutions](https://webpack.js.org/configura
5353
- `[git-revision-version]`
5454
- `[git-revision-hash]`
5555
- `[git-revision-branch]` (only [when branch is enabled](#branch-false))
56+
- `[git-revision-last-commit-datetime]`
5657

5758
Example:
5859

@@ -67,7 +68,7 @@ module.exports = {
6768

6869
## Plugin API
6970

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.
7172

7273
Example using the [DefinePlugin](https://webpack.js.org/plugins/define-plugin/#usage):
7374

@@ -80,6 +81,7 @@ module.exports = {
8081
'VERSION': JSON.stringify(gitRevisionPlugin.version()),
8182
'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
8283
'BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
84+
'LASTCOMMITDATETIME': JSON.stringify(gitRevisionPlugin.lastcommitdatetime()),
8385
})
8486
]
8587
}
@@ -169,6 +171,22 @@ module.exports = {
169171
}
170172
```
171173

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+
172190
## Outdated webpack
173191

174192
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

Comments
 (0)