better handling of frontend updates, following svelte docs

This commit is contained in:
Jan Kessler
2025-05-13 07:48:29 +02:00
parent a904f874ee
commit dfd4037132
3 changed files with 20 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-static';
import * as child_process from 'node:child_process';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
@@ -14,7 +15,12 @@ const config = {
pages: 'build',
assets: 'build',
fallback: 'index.html'
})
}),
// poll for new version name every 60 seconds (to trigger reload mechanic in +layout.svelte)
version: {
name: child_process.execSync('git rev-parse HEAD').toString().trim(),
pollInterval: 60000
}
},
vitePlugin: {
// inspector: {