fix: enable sentry only in build

This commit is contained in:
Torsten Dittmann
2024-06-26 12:45:00 +02:00
parent 4cdb92c649
commit b1ca9027e7
3 changed files with 7 additions and 4 deletions

View File

@@ -3,10 +3,11 @@ import type { Handle } from '@sveltejs/kit';
import redirects from './redirects.json';
import { sequence } from '@sveltejs/kit/hooks';
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
import { dev } from '$app/environment';
import { SENTRY_AUTH_TOKEN } from '$env/static/private';
import { building } from '$app/environment';
Sentry.init({
enabled: !dev,
enabled: !!SENTRY_AUTH_TOKEN && building,
dsn: SENTRY_DSN,
tracesSampleRate: 1
})