diff --git a/apps/app/next.config.js b/apps/app/next.config.js index 9dbb29c7e..6ebb5a4a9 100644 --- a/apps/app/next.config.js +++ b/apps/app/next.config.js @@ -1,10 +1,4 @@ -// This file sets a custom webpack configuration to use your Next.js app -// with Sentry. -// https://nextjs.org/docs/api-reference/next.config.js/introduction -// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ const { withSentryConfig } = require("@sentry/nextjs"); - -/** @type {import('next').NextConfig} */ const path = require("path"); const nextConfig = { @@ -18,34 +12,10 @@ const nextConfig = { ], }, output: "standalone", - experimental: { - outputFileTracingRoot: path.join(__dirname, "../../"), - transpilePackages: ["components/ui"], - }, }; -module.exports = nextConfig; - -// const withPWA = require("next-pwa")({ -// dest: "public", -// }); - -// module.exports = withPWA({ -// pwa: { -// dest: "public", -// register: true, -// skipWaiting: true, -// }, -// reactStrictMode: false, -// swcMinify: true, -// images: { -// domains: ["vinci-web.s3.amazonaws.com"], -// }, -// output: "standalone", -// experimental: { -// outputFileTracingRoot: path.join(__dirname, "../../"), -// transpilePackages: ["components/ui"], -// }, -// }); - -module.exports = withSentryConfig(module.exports, { silent: true }, { hideSourcemaps: true }); +if (process.env.NEXT_PUBLIC_SENTRY_DSN) { + module.exports = withSentryConfig(nextConfig, { silent: true }, { hideSourceMaps: true }); +} else { + module.exports = nextConfig; +} diff --git a/apps/app/sentry.client.config.js b/apps/app/sentry.client.config.js index 8816c47b1..ca473045b 100644 --- a/apps/app/sentry.client.config.js +++ b/apps/app/sentry.client.config.js @@ -8,6 +8,7 @@ const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; Sentry.init({ dsn: SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || "development", // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: 1.0, // ... diff --git a/apps/app/sentry.edge.config.js b/apps/app/sentry.edge.config.js index e6347794f..8374ed410 100644 --- a/apps/app/sentry.edge.config.js +++ b/apps/app/sentry.edge.config.js @@ -8,6 +8,7 @@ const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; Sentry.init({ dsn: SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || "development", // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: 1.0, // ... diff --git a/apps/app/sentry.server.config.js b/apps/app/sentry.server.config.js index db1fbc4b1..d2acb07e1 100644 --- a/apps/app/sentry.server.config.js +++ b/apps/app/sentry.server.config.js @@ -8,6 +8,7 @@ const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; Sentry.init({ dsn: SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || "development", // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: 1.0, // ... diff --git a/turbo.json b/turbo.json index b4658a0df..f20ceecdf 100644 --- a/turbo.json +++ b/turbo.json @@ -7,7 +7,9 @@ "NEXT_PUBLIC_DOCSEARCH_API_KEY", "NEXT_PUBLIC_DOCSEARCH_APP_ID", "NEXT_PUBLIC_DOCSEARCH_INDEX_NAME", - "NEXT_PUBLIC_SENTRY_DSN" + "NEXT_PUBLIC_SENTRY_DSN", + "SENTRY_AUTH_TOKEN", + "NEXT_PUBLIC_SENTRY_ENVIRONMENT" ], "pipeline": { "build": {