From e9c03a662e8e92e8b3e3ac4db4cf3284a235c9c5 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 28 Oct 2024 22:14:00 +0000 Subject: [PATCH] add is prod check to Sentry --- projects/website/next.config.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/projects/website/next.config.ts b/projects/website/next.config.ts index 853399e..0f0966d 100644 --- a/projects/website/next.config.ts +++ b/projects/website/next.config.ts @@ -2,6 +2,7 @@ import { withSentryConfig } from "@sentry/nextjs"; import { format } from "@formkit/tempo"; import nextBundleAnalyzer from "@next/bundle-analyzer"; import type { NextConfig } from "next"; +import { isProduction } from "@/common/website-utils"; const nextConfig: NextConfig = { experimental: { @@ -41,14 +42,18 @@ const withBundleAnalyzer = nextBundleAnalyzer({ enabled: process.env.ANALYZE === "true", }); -export default withSentryConfig(withBundleAnalyzer(nextConfig), { - org: "fascinatedcc", - project: "scoresaber-reloaded", - silent: !process.env.CI, - widenClientFileUpload: true, - reactComponentAnnotation: { - enabled: true, - }, - hideSourceMaps: true, - disableLogger: true, -}); +const config = withBundleAnalyzer(nextConfig); + +export default isProduction() + ? withSentryConfig(config, { + org: "fascinatedcc", + project: "scoresaber-reloaded", + silent: !process.env.CI, + widenClientFileUpload: true, + reactComponentAnnotation: { + enabled: true, + }, + hideSourceMaps: true, + disableLogger: true, + }) + : config;