67 lines
1.7 KiB
TypeScript
67 lines
1.7 KiB
TypeScript
import { paraglideVitePlugin } from '@inlang/paraglide-js';
|
|
import { defineConfig } from 'vitest/config';
|
|
import { playwright } from '@vitest/browser-playwright';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tailwindcss(),
|
|
sveltekit(),
|
|
paraglideVitePlugin({ project: './project.inlang', outdir: './src/lib/paraglide' })
|
|
],
|
|
optimizeDeps: {
|
|
exclude: ['@matrix-org/matrix-sdk-crypto-wasm']
|
|
},
|
|
ssr: {
|
|
noExternal: [],
|
|
external: ['@matrix-org/matrix-sdk-crypto-wasm']
|
|
},
|
|
server: {
|
|
watch: {
|
|
// Reduce file-watcher overhead on Windows - ignore heavy dirs
|
|
ignored: ['**/node_modules/**', '**/test-results/**', '**/project.inlang/cache/**', '**/.svelte-kit/**']
|
|
}
|
|
},
|
|
test: {
|
|
expect: { requireAssertions: true },
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: ['src/lib/api/**/*.ts', 'src/lib/utils/logger.ts', 'src/lib/utils/permissions.ts'],
|
|
exclude: ['**/*.test.ts', '**/*.spec.ts', '**/*.d.ts', '**/types.ts', '**/index.ts', '**/google-calendar-push.ts'],
|
|
reporter: ['text', 'text-summary'],
|
|
thresholds: {
|
|
statements: 90,
|
|
branches: 85,
|
|
functions: 90,
|
|
lines: 90,
|
|
},
|
|
},
|
|
projects: [
|
|
{
|
|
extends: './vite.config.ts',
|
|
test: {
|
|
name: 'client',
|
|
browser: {
|
|
enabled: true,
|
|
provider: playwright(),
|
|
instances: [{ browser: 'chromium', headless: true }]
|
|
},
|
|
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
|
|
exclude: ['src/lib/server/**']
|
|
}
|
|
},
|
|
|
|
{
|
|
extends: './vite.config.ts',
|
|
test: {
|
|
name: 'server',
|
|
environment: 'node',
|
|
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
|
|
}
|
|
}
|
|
]
|
|
}
|
|
});
|