mirror of
https://github.com/Arlind-dev/sulej.ch.git
synced 2025-12-01 01:25:14 +01:00
feat(init)!: create sulej.ch
This commit is contained in:
23
vite.config.ts
Normal file
23
vite.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
},
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user