feat(build): inject build time and version into health endpoint
Vite define injects __BUILD_TIME__ and __BUILD_VERSION__ at build time so /health returns the exact timestamp and package version of the running build — useful for verifying deploys without guessing what changed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'));
|
||||
|
||||
export default defineConfig({
|
||||
cacheDir: 'node_modules/.vite',
|
||||
define: {
|
||||
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
|
||||
__BUILD_VERSION__: JSON.stringify(pkg.version)
|
||||
},
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
sveltekit() // <-- Must come after Tailwind
|
||||
|
||||
Reference in New Issue
Block a user