diff --git a/vite.config.ts b/vite.config.ts index fce9e87..661e207 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,16 @@ import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; +import pkg from './package.json' with { type: 'json' }; + +declare const process: { + env: Record; +}; + +const appVersion = process.env.VITE_APP_VERSION ?? pkg.version ?? 'dev'; export default defineConfig({ + define: { + __APP_VERSION__: JSON.stringify(appVersion), + }, plugins: [sveltekit()], });