import { paraglideVitePlugin } from '@inlang/paraglide-js'; import tailwindcss from '@tailwindcss/vite'; import adapter from '@sveltejs/adapter-node'; import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; export default defineConfig({ plugins: [ tailwindcss(), paraglideVitePlugin({ project: './project.inlang', outdir: './src/lib/paraglide', // Order is the precedence. The account setting wins, because a // language a person chose should follow them to every device; the // cookie keeps that decision available before /me has answered; // the browser's Accept-Language is the first-contact guess; the // base locale is the floor. No `url` strategy: Pablan is one // installation for one company, so /de/ path prefixes would buy // nothing and break every existing link. strategy: ['custom-userPreference', 'cookie', 'preferredLanguage', 'baseLocale'], // A missing translation must fail the build, never fall back // silently to another language (see scripts/check-messages.py). experimentalMiddlewareLocaleSplitting: false }), sveltekit({ compilerOptions: { // Force runes mode for the project, except for libraries. Can be removed in svelte 6. runes: ({ filename }) => filename.split(/[/\\]/).includes('node_modules') ? undefined : true }, adapter: adapter() }) ], server: { // Dev-only same-origin setup: /api goes to the native FastAPI process. // In production the reverse proxy does this (see deploy/). proxy: { '/api': 'http://localhost:8000' } } });