From d92595fa81a0ef690677d50580e9d66fb4eed739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Maro=C5=A1i?= Date: Wed, 4 Oct 2023 10:43:35 +0200 Subject: [PATCH] Remove unnecessary sentry code from prod build. --- config/webpack.plugins.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/webpack.plugins.js b/config/webpack.plugins.js index 74c8324bca..0d63a21b6e 100644 --- a/config/webpack.plugins.js +++ b/config/webpack.plugins.js @@ -76,6 +76,14 @@ const plugins = (dev = false, beta = false) => { Buffer: ['buffer', 'Buffer'], }), new ForkTsCheckerWebpackPlugin(), + /** + * Removes error for a missing logger function + * https://github.com/getsentry/sentry-javascript/issues/6596 + * https://docs.sentry.io/platforms/javascript/guides/react/configuration/tree-shaking/#tree-shaking-optional-code + */ + new webpack.DefinePlugin({ + __SENTRY_DEBUG__: false, + }), ...(dev ? [new ReactRefreshWebpackPlugin()] : []), ]; };