File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,8 @@ export function getCurrentHub(): Hub {
454454 */
455455function getHubFromActiveDomain ( registry : Carrier ) : Hub {
456456 try {
457- const domain = require ( 'domain' ) ;
457+ const req = require ;
458+ const domain = req ( 'domain' ) ;
458459 const activeDomain = domain . active ;
459460
460461 // If there no active domain, just return global hub
Original file line number Diff line number Diff line change @@ -20,16 +20,6 @@ interface SentryGlobal {
2020 } ;
2121}
2222
23- /**
24- * Requires a module which is protected against bundler minification.
25- *
26- * @param request The module path to resolve
27- */
28- export function dynamicRequire ( mod : any , request : string ) : any {
29- // tslint:disable-next-line: no-unsafe-any
30- return mod . require ( request ) ;
31- }
32-
3323/**
3424 * Checks whether we're in the Node.js or Browser environment
3525 *
@@ -375,7 +365,8 @@ const performanceFallback: CrossPlatformPerformance = {
375365export const crossPlatformPerformance : CrossPlatformPerformance = ( ( ) => {
376366 if ( isNodeEnv ( ) ) {
377367 try {
378- const perfHooks = dynamicRequire ( module , 'perf_hooks' ) as { performance : CrossPlatformPerformance } ;
368+ const req = require ;
369+ const perfHooks = req ( 'perf_hooks' ) as { performance : CrossPlatformPerformance } ;
379370 return perfHooks . performance ;
380371 } catch ( _ ) {
381372 return performanceFallback ;
You can’t perform that action at this time.
0 commit comments