feat: add footer with app version
This commit is contained in:
@@ -1,16 +1,28 @@
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
import svgLoader from "vite-svg-loader";
|
||||
|
||||
function getGitCommitHash(): string {
|
||||
try {
|
||||
return execSync("git rev-parse --short HEAD").toString().trim();
|
||||
} catch (error) {
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: "./",
|
||||
build: {
|
||||
target: "esnext",
|
||||
},
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(getGitCommitHash()),
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
target: "esnext",
|
||||
|
||||
Reference in New Issue
Block a user