From a046ef4a165e9581847c0d4ff091a994c0e635ec Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Wed, 4 Dec 2024 00:17:15 +0300 Subject: [PATCH] feat: update next config for better local hosting --- next.config.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/next.config.js b/next.config.js index c7becdf..cf7b712 100644 --- a/next.config.js +++ b/next.config.js @@ -29,21 +29,27 @@ const config = { }, }; -const bundleAnalyzerConfig = withBundleAnalyzer(config); +const configExport = () => { + if (process.env.ANALYZE === "true") return withBundleAnalyzer(config); -const sentryConfig = withSentryConfig( - config, - { - silent: true, - org: "aykut-sarac", - project: "json-crack", - }, - { - widenClientFileUpload: true, - hideSourceMaps: true, - disableLogger: true, - disableServerWebpackPlugin: true, + if (process.env.GITHUB_REPOSITORY === "AykutSarac/jsoncrack.com") { + return withSentryConfig( + config, + { + silent: true, + org: "aykut-sarac", + project: "json-crack", + }, + { + widenClientFileUpload: true, + hideSourceMaps: true, + disableLogger: true, + disableServerWebpackPlugin: true, + } + ); } -); -module.exports = process.env.ANALYZE === "true" ? bundleAnalyzerConfig : sentryConfig; + return config; +}; + +module.exports = configExport();