Fix product performance grouped JSON build

This commit is contained in:
M_Kececi
2026-08-18 20:19:24 +03:00
parent c4028010c0
commit cd101811c4
2 changed files with 36 additions and 1 deletions
+15 -1
View File
@@ -1,8 +1,20 @@
// quasar.config.js
import { defineConfig } from '#q-app/wrappers'
import { execSync } from 'node:child_process'
function readGitBuildInfo () {
try {
const commitCount = execSync('git rev-list --count HEAD', { encoding: 'utf8' }).trim()
const commitHash = execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim()
return { version: `v1.0.${commitCount}`, commit: commitHash }
} catch {
return { version: 'v1.0.0', commit: 'local' }
}
}
export default defineConfig(() => {
const apiBaseUrl = (process.env.VITE_API_BASE_URL || '/api').trim()
const gitBuildInfo = readGitBuildInfo()
return {
@@ -36,7 +48,9 @@ export default defineConfig(() => {
build: {
vueRouterMode: 'hash',
env: {
VITE_API_BASE_URL: apiBaseUrl
VITE_API_BASE_URL: apiBaseUrl,
APP_VERSION: gitBuildInfo.version,
APP_COMMIT: gitBuildInfo.commit
},
esbuildTarget: {