From dac74bc9d86a302d77f640c6e3b8d9c8e0120a56 Mon Sep 17 00:00:00 2001 From: ccbikai Date: Wed, 18 Sep 2024 20:52:59 +0800 Subject: [PATCH] chore: conditionally enable Sentry integration based on environment variable Conditionally enables Sentry integration only if the SENTRY_DSN environment variable is set, improving build efficiency and reducing unnecessary dependencies. --- astro.config.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index f2bbbadb..eb8e9215 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -29,7 +29,7 @@ export default defineConfig({ output: 'hybrid', adapter: providers[adapterProvider] || providers.node, integrations: [ - ...process.env.SENTRY_DSN + ...(process.env.SENTRY_DSN ? [ sentry({ enabled: { @@ -44,7 +44,7 @@ export default defineConfig({ }, }), ] - : [], + : []), ], vite: { ssr: {