Files
SlpSoftware/vite.config.ts
2026-07-25 15:46:58 +02:00

34 lines
1.1 KiB
TypeScript

/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { version } from './package.json';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
define: {
// Injected at build time, used as the Sentry `release` tag (see src/main.tsx).
__APP_VERSION__: JSON.stringify(version),
},
server: {
proxy: {
// Mirrors the reverse-proxy Pi's "/sentry-tunnel" location (see
// nginx/reverse-proxy-nginx.conf.example) so the same tunnel path also
// works locally during `pnpm dev`, avoiding ad-blocker ERR_BLOCKED_BY_CLIENT
// errors when testing locally too (see src/main.tsx's Sentry.init tunnel option).
// LET OP: moet in sync blijven met de VITE_SENTRY_DSN uit .env.local.
'/sentry-tunnel': {
target: 'https://o4511795618185216.ingest.de.sentry.io',
changeOrigin: true,
rewrite: () => '/api/4511795622838352/envelope/',
},
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: './src/test/setup.ts',
css: true,
},
});