forked from mirror/crumbs-original
fix: pass app version via server load instead of Vite define
The Svelte 5 SSR compiler was optimizing away the __APP_VERSION__ constant set via Vite's define, causing the version to be missing from the production footer. Use a +layout.server.ts load function to pass the version from package.json instead. Also bumps version to 0.1.6. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3b3a1b4ff0
commit
a9779c93aa
@@ -1,15 +1,9 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(pkg.version)
|
||||
},
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
sveltekit(),
|
||||
|
||||
Reference in New Issue
Block a user