Add source code link with git hash, plus modification dates
This commit is contained in:
parent
acad9c5944
commit
fb667871b4
4 changed files with 30 additions and 4 deletions
|
|
@ -1,6 +1,18 @@
|
|||
export default {
|
||||
build: {
|
||||
sourcemap: true,
|
||||
target: 'es2022',
|
||||
var childProcess = require('child_process');
|
||||
|
||||
export default () => {
|
||||
// https://stackoverflow.com/a/71162041/3814663
|
||||
const commitDate = childProcess.execSync('git log -1 --format=%cI').toString().trimEnd();
|
||||
const commitHash = childProcess.execSync('git rev-parse HEAD').toString().trimEnd();
|
||||
const fileDates = childProcess.execSync(`find . -iname '*.geojson' -not -path './dist/*' | xargs ls -lh`).toString().trimEnd();
|
||||
process.env.VITE_GIT_COMMIT_DATE = commitDate;
|
||||
process.env.VITE_GIT_COMMIT_HASH = commitHash;
|
||||
process.env.VITE_FILE_DATES = fileDates;
|
||||
|
||||
return {
|
||||
build: {
|
||||
sourcemap: true,
|
||||
target: 'es2022',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue