feat: show commit hash in footer and implement auto server health check for AppWPP
This commit is contained in:
+17
-1
@@ -1,9 +1,25 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
let commitHash = process.env.COMMIT_REF
|
||||
? process.env.COMMIT_REF.slice(0, 7)
|
||||
: '';
|
||||
|
||||
if (!commitHash) {
|
||||
try {
|
||||
commitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
||||
} catch (e) {
|
||||
commitHash = 'dev';
|
||||
}
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
define: {
|
||||
__COMMIT_HASH__: JSON.stringify(commitHash)
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api-wpp': {
|
||||
|
||||
Reference in New Issue
Block a user