mirror of
https://github.com/Arlind-dev/sulej.ch.git
synced 2025-12-01 09:35:13 +01:00
24 lines
593 B
TypeScript
24 lines
593 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { execSync } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
|
|
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
|
|
const version = `v${pkg.version}`;
|
|
|
|
let commit = 'dev';
|
|
try {
|
|
commit = execSync('git rev-parse --short HEAD').toString().trim();
|
|
} catch {
|
|
// ignore if git not available (e.g. CI build image)
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [sveltekit()],
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(version),
|
|
__APP_COMMIT__: JSON.stringify(commit)
|
|
},
|
|
|
|
});
|