File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * This module mostly exists for optimizations in the build process
3
- * through rollup and terser. We define some global constants which
4
- * are normally undefined. However terser overrides these with global
5
- * definitions which can be evaluated by the static analyzer when
6
- * creating a bundle.
7
- *
8
- * In turn the `isDebugBuild` and `isBrowserBundle` functions are pure
9
- * and can help us remove unused code from the bundles.
2
+ * This module exists for optimizations in the build process through rollup and terser. We define some global
3
+ * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these
4
+ * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will
5
+ * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to
6
+ * `logger` and preventing node-related code from appearing in browser bundles.
10
7
*/
11
8
12
9
declare const __SENTRY_BROWSER_BUNDLE__ : boolean | undefined ;
13
- declare const __SENTRY_NO_DEBUG__ : boolean | undefined ;
10
+
11
+ const __SENTRY_DEBUG__ = true ;
14
12
15
13
/**
16
14
* Figures out if we're building with debug functionality.
17
15
*
18
16
* @returns true if this is a debug build
19
17
*/
20
18
export function isDebugBuild ( ) : boolean {
21
- return typeof __SENTRY_NO_DEBUG__ !== 'undefined' && ! __SENTRY_BROWSER_BUNDLE__ ;
19
+ return __SENTRY_DEBUG__ ;
22
20
}
23
21
24
22
/**
You can’t perform that action at this time.
0 commit comments