From fdfff4e10fb7ffda8a74915003bc1c0eb811cc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Wed, 13 Jun 2018 16:41:06 +0200 Subject: [PATCH] should fix Sentry to work in prod --- src/sentry/install.js | 6 ++---- webpack/plugins.js | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sentry/install.js b/src/sentry/install.js index acfb33e0..d556339f 100644 --- a/src/sentry/install.js +++ b/src/sentry/install.js @@ -2,11 +2,9 @@ require('../env') -const { SENTRY_URL } = process.env - export default (Raven: any, shouldSendCallback: () => boolean, userId: string) => { - if (!SENTRY_URL) return - let r = Raven.config(SENTRY_URL, { + if (!__SENTRY_URL__) return + let r = Raven.config(__SENTRY_URL__, { captureUnhandledRejections: true, allowSecretKey: true, release: __APP_VERSION__, diff --git a/webpack/plugins.js b/webpack/plugins.js index af1b4b64..a19bfd87 100644 --- a/webpack/plugins.js +++ b/webpack/plugins.js @@ -3,7 +3,7 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') const pkg = require('../package.json') require('../src/globals') -const { BUNDLE_ANALYZER } = process.env +const { BUNDLE_ANALYZER, SENTRY_URL } = process.env module.exports = type => { const plugins = [ @@ -12,6 +12,7 @@ module.exports = type => { __GLOBAL_STYLES__: JSON.stringify(__GLOBAL_STYLES__), __DEV__, __PROD__, + __SENTRY_URL__: SENTRY_URL, 'process.env.NODE_ENV': JSON.stringify(__ENV__), }), ]