feat: implement automated versioning.

This commit is contained in:
Xiaohan-Tian
2025-08-28 22:23:47 -07:00
parent 62b3a8c8d7
commit 0eac49493c
9 changed files with 7586 additions and 1 deletions
+11
View File
@@ -1,8 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { fileURLToPath, URL } from 'node:url'
// Read version from package.json
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const packageJson = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'))
const version = packageJson.version
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: '/kgstudio/',
define: {
__APP_VERSION__: JSON.stringify(version),
},
})