diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts new file mode 100644 index 0000000..412c565 --- /dev/null +++ b/frontend/src/app.d.ts @@ -0,0 +1,16 @@ +// Ambient type declarations for SvelteKit + project-level build-time globals. + +declare global { + /** App version, injected from frontend/package.json at build time. */ + const __APP_VERSION__: string; + + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 777997b..8bd35e9 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,9 +1,18 @@ import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'vite'; +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; + +const pkg = JSON.parse( + readFileSync(fileURLToPath(new URL('./package.json', import.meta.url)), 'utf8'), +); export default defineConfig({ plugins: [tailwindcss(), sveltekit()], + define: { + __APP_VERSION__: JSON.stringify(pkg.version), + }, server: { port: 5175, proxy: {