From 68a137acf9822ff1e9b0f6e02668991b6c98dae9 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 18 Jun 2023 15:01:49 +0200 Subject: [PATCH] chore(sentry): only load sentry when enabled --- src/main.ts | 3 +-- src/sentry.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 347d5d392..7be385544 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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) } diff --git a/src/sentry.ts b/src/sentry.ts index 3f143829b..747f8aec9 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -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')