Browse Source

move isSentryEnabled needed by both config util and constants/sentry to seperate file sentryConfigUtil

as neither of the two files can import each other
Abhinav 3 years ago
parent
commit
5427fbf232
3 changed files with 6 additions and 7 deletions
  1. 2 4
      configUtil.js
  2. 3 0
      sentryConfigUtil.js
  3. 1 3
      src/constants/sentry/index.ts

+ 2 - 4
configUtil.js

@@ -1,4 +1,5 @@
 const cp = require('child_process');
+const { isSentryEnabled } = require('./sentryConfigUtil');
 
 module.exports = {
     COOP_COEP_HEADERS: {
@@ -50,8 +51,5 @@ module.exports = {
             cwd: __dirname,
             encoding: 'utf8',
         }),
-
-    isSentryEnabled: () =>
-        process.env.SENTRY_ENABLED ??
-        (process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development') !== 'development',
+    isSentryEnabled: isSentryEnabled,
 };

+ 3 - 0
sentryConfigUtil.js

@@ -0,0 +1,3 @@
+module.exports.isSentryEnabled = () =>
+    process.env.SENTRY_ENABLED ??
+    (process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development') !== 'development';

+ 1 - 3
src/constants/sentry/index.ts

@@ -7,6 +7,4 @@ export const getSentryENV = () =>
 
 export const getSentryRelease = () => process.env.SENTRY_RELEASE;
 
-export const isSentryEnabled = () =>
-    process.env.SENTRY_ENABLED ??
-    (process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development') !== 'development';
+export { isSentryEnabled } from '../../../sentryConfigUtil';