chore(sentry): only load sentry when enabled

This commit is contained in:
kolaente 2023-06-18 15:01:49 +02:00
parent 95ba8b8a11
commit 68a137acf9
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 2 additions and 3 deletions

View File

@ -105,8 +105,7 @@ setLanguage(browserLanguage).then(() => {
if (window.SENTRY_ENABLED) {
try {
import {setupSentry} from './sentry'
setupSentry(app, router).then(sentry => sentry.default(app, router))
import('./sentry').then(sentry => sentry.default(app, router))
} catch (e) {
console.error('Could not enable Sentry tracking', e)
}

View File

@ -2,7 +2,7 @@ import 'virtual:vite-plugin-sentry/sentry-config'
import type {App} from 'vue'
import type {Router} from 'vue-router'
export async function setupSentry(app: App, router: Router) {
export default async function setupSentry(app: App, router: Router) {
const Sentry = await import('@sentry/vue')
const {Integrations} = await import('@sentry/tracing')