From b353a0bee78b985bdb118f13539abecebb1ce4fd Mon Sep 17 00:00:00 2001 From: Dmytro Hryshyn Date: Wed, 20 Dec 2023 18:15:19 +0200 Subject: [PATCH] chore: allow disabling source map generation with env var --- .env.example | 3 +++ apps/web/next.config.js | 2 ++ turbo.json | 1 + 3 files changed, 6 insertions(+) diff --git a/.env.example b/.env.example index 204be5fe9dfc23..fe20c06586a639 100644 --- a/.env.example +++ b/.env.example @@ -320,3 +320,6 @@ APP_ROUTER_SETTINGS_TEAMS_ENABLED=0 APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0 APP_ROUTER_APPS_ENABLED=0 APP_ROUTER_VIDEO_ENABLED=0 + +# disable setry server source maps +SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN=1 \ No newline at end of file diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 9ac7032c8cd7cf..58c928083f54e4 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -572,6 +572,8 @@ if (!!process.env.NEXT_PUBLIC_SENTRY_DSN) { nextConfig["sentry"] = { autoInstrumentServerFunctions: true, hideSourceMaps: true, + // disable source map generation for the server code + disableServerWebpackPlugin: !!process.env.SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN, }; plugins.push(withSentryConfig); diff --git a/turbo.json b/turbo.json index 250cca10cf2f0a..4c6efe5b241806 100644 --- a/turbo.json +++ b/turbo.json @@ -316,6 +316,7 @@ "SENDGRID_API_KEY", "SENDGRID_EMAIL", "SENDGRID_SYNC_API_KEY", + "SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN", "SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET", "SLACK_SIGNING_SECRET",