U6: Lighthouse-gate in CI (mobiel+desktop >= 0.9), font-preload hero, privacyopzet bijgewerkt

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 14:35:54 +01:00
co-authored by Claude Sonnet 5.5
parent a2fe4c14b0
commit 551b3fa101
8 changed files with 2285 additions and 26 deletions
+28 -2
View File
@@ -1,11 +1,37 @@
/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
import { defineConfig, type Plugin } from 'vite';
import react from '@vitejs/plugin-react';
import { version } from './package.json';
// Preloads the latin display font (Archivo, used by the hero heading and the
// 2026 section) so it is requested with the HTML instead of after the CSS has
// been parsed. Build only: in dev the bundle is not available.
const preloadHeroFont = (): Plugin => ({
name: 'preload-hero-font',
transformIndexHtml: {
order: 'post',
handler(_html, ctx) {
if (!ctx.bundle) return [];
return Object.keys(ctx.bundle)
.filter((file) => /archivo-latin-wdth-normal-.*\.woff2$/.test(file))
.map((file) => ({
tag: 'link',
attrs: {
rel: 'preload',
as: 'font',
type: 'font/woff2',
href: `/${file}`,
crossorigin: '',
},
injectTo: 'head-prepend' as const,
}));
},
},
});
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react(), preloadHeroFont()],
define: {
// Injected at build time, used as the Sentry `release` tag (see src/main.tsx).
__APP_VERSION__: JSON.stringify(version),