mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 20:06:57 +02:00
feat: display app version in footer
Inject version from package.json at build time via Vite's define and show it in the layout footer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
10371f6c94
commit
08d6dbc13d
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "crumbs",
|
||||
"private": true,
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
Vendored
+2
@@ -1,5 +1,7 @@
|
||||
// See https://svelte.dev/docs/kit/types#app.d.ts
|
||||
// for information about these interfaces
|
||||
declare const __APP_VERSION__: string;
|
||||
|
||||
declare global {
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</main>
|
||||
|
||||
<footer class="pb-4 pt-8 text-center text-xs text-gray-400 lg:ml-64">
|
||||
Crumbs by Bretzel — made with 🥨 in Strasbourg
|
||||
Crumbs by Bretzel v{__APP_VERSION__} — made with 🥨 in Strasbourg
|
||||
</footer>
|
||||
|
||||
<Toast />
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
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