BLOG-58 feat: add app versioning support and update layout to include version meta tag
All checks were successful
Frontend CI / build (push) Successful in 1m32s

This commit is contained in:
SquidSpirit 2025-07-23 04:49:08 +08:00
parent 96a0017f94
commit ecb8384c22
3 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,8 @@ declare global {
// interface PageData {} // interface PageData {}
// interface PageState {} // interface PageState {}
// interface Platform {} // interface Platform {}
declare const __VERSION__: string;
} }
} }

View File

@ -5,6 +5,9 @@
import '@fortawesome/fontawesome-free/css/all.min.css'; import '@fortawesome/fontawesome-free/css/all.min.css';
</script> </script>
<svelte:head>
<meta name="app-version" content={App.__VERSION__} />
</svelte:head>
<div class="min-h-screen"> <div class="min-h-screen">
<Navbar /> <Navbar />
<slot /> <slot />

View File

@ -2,6 +2,11 @@ import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite'; import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { version } from './package.json';
export default defineConfig({ export default defineConfig({
plugins: [tailwindcss(), sveltekit()] plugins: [tailwindcss(), sveltekit()],
define: {
'App.__VERSION__': JSON.stringify(version)
}
}); });