fix(web): ship fonts as files so the CSP lets them load

Vite inlined the two smallest Hanken Grotesk and JetBrains Mono subsets as
data: URLs. The sidecar and Tauri CSPs allow fonts from 'self' only, so
the browser blocked them and those character ranges fell back to a system
font. Fonts are now never inlined.
This commit is contained in:
shumeiko.it
2026-11-01 01:36:50 +01:00
parent 3a426a5423
commit 413956e0a1

View File

@@ -30,6 +30,9 @@ export default defineConfig(({ mode }) => ({
},
plugins: [react(), mode === "development" && componentTagger()].filter(Boolean),
build: {
// Fonts stay separate files: the sidecar and Tauri CSPs allow fonts from
// 'self' only, so a small subset inlined as a data: URL would be blocked.
assetsInlineLimit: (filePath: string) => (/\.(?:woff2?|ttf|otf)$/.test(filePath) ? false : undefined),
rollupOptions: {
output: {
// Split the heaviest independent vendor libraries out of the single