add cool git commit thing
This commit is contained in:
1 parent
cddb7e6aff
commit
b34d3a5854
2 files changed
+17
-2
No files matched your search
+14
-1
@@ -11,9 +11,23 @@ import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
// Utilities
|
||||
import { defineConfig } from 'vite'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
// Get git commit hash
|
||||
const getGitHash = () => {
|
||||
try {
|
||||
return execSync('git rev-parse --short HEAD').toString().trim()
|
||||
} catch (e) {
|
||||
return 'unknown'
|
||||
}
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
define: {
|
||||
'__GIT_COMMIT_HASH__': JSON.stringify(getGitHash()),
|
||||
'process.env': {}
|
||||
},
|
||||
plugins: [
|
||||
VueRouter(),
|
||||
Layouts(),
|
||||
@@ -59,7 +73,6 @@ export default defineConfig({
|
||||
'unplugin-vue-router/data-loaders/basic',
|
||||
],
|
||||
},
|
||||
define: { 'process.env': {} },
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('src', import.meta.url)),
|
||||
|
||||
Reference in new issue
Block a user