From 7579417d7e61aa3d2a97ff2bd6b53831c89ca2cd Mon Sep 17 00:00:00 2001 From: DmytroHryshyn <125881252+DmytroHryshyn@users.noreply.github.com> Date: Fri, 29 Dec 2023 20:21:19 +0200 Subject: [PATCH] chore: allow disabling source map generation with env var (#12899) --- .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 799046ac34..71357c2d7c 100644 --- a/.env.example +++ b/.env.example @@ -322,3 +322,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 9ac7032c8c..58c928083f 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 149f8ae519..b0ed2de782 100644 --- a/turbo.json +++ b/turbo.json @@ -318,6 +318,7 @@ "SENDGRID_API_KEY", "SENDGRID_EMAIL", "SENDGRID_SYNC_API_KEY", + "SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN", "SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET", "SLACK_SIGNING_SECRET",