From b9dfd0e71e937ee1a3e32ba507ee1b9aceddfb37 Mon Sep 17 00:00:00 2001 From: Satbir Singh Date: Thu, 5 Mar 2020 09:17:10 +0000 Subject: [PATCH] No sentry source maps uploaded on local build. --- app/client/craco.build.config.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/client/craco.build.config.js b/app/client/craco.build.config.js index 85ec315953..f20adf3bd2 100644 --- a/app/client/craco.build.config.js +++ b/app/client/craco.build.config.js @@ -3,14 +3,20 @@ const SentryWebpackPlugin = require('@sentry/webpack-plugin'); const merge = require('webpack-merge'); const common = require('./craco.common.config.js'); +const env = process.env.REACT_APP_ENVIRONMENT + +const plugins = [] + +if(env === "PRODUCTION" || env === "STAGING") { + plugins.push(new SentryWebpackPlugin({ + include: 'build', + ignore: ['node_modules', 'webpack.config.js'], + release: process.env.REACT_APP_SENTRY_RELEASE + })) +} + module.exports = merge(common, { webpack: { - plugins: [ - new SentryWebpackPlugin({ - include: 'build', - ignore: ['node_modules', 'webpack.config.js'], - release: process.env.REACT_APP_SENTRY_RELEASE - }) - ] + plugins: plugins }, });