2024-02-02 23:03:04 -06:00
|
|
|
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();
|
2024-09-02 10:51:25 -05:00
|
|
|
const fileDates = childProcess.execSync(`find . -iname '*.geojson' -not -path './dist/*' -exec ls -lh {} +`).toString().trimEnd();
|
2024-02-02 23:03:04 -06:00
|
|
|
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',
|
|
|
|
}
|
2023-07-03 00:20:36 -05:00
|
|
|
}
|
|
|
|
}
|