- Vite now forwards /health to Rust proxy (port 8888) - Required for Admin Panel proxy health check to work in dev mode - External Caddy reverse proxy may also need /health forwarding rule
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path'
|
|
import { execSync } from 'child_process'
|
|
|
|
const gitHash = execSync('git log --format="%h" -1', { encoding: 'utf-8' }).trim()
|
|
const buildTime = new Date().toISOString().slice(0, 19).replace(/[-:T]/g, '')
|
|
const buildVersion = `${buildTime}-${gitHash}`
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
define: {
|
|
__BUILD_VERSION__: JSON.stringify(buildVersion)
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
strictPort: true,
|
|
allowedHosts: [
|
|
'studio.momentry.ddns.net',
|
|
'localhost',
|
|
'127.0.0.1',
|
|
'.ddns.net'
|
|
],
|
|
proxy: {
|
|
'/api/v1': {
|
|
target: 'http://localhost:8888',
|
|
changeOrigin: true,
|
|
},
|
|
'/api/v2': {
|
|
target: 'http://localhost:11438',
|
|
changeOrigin: true
|
|
},
|
|
'/health': {
|
|
target: 'http://localhost:8888',
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
}
|
|
})
|