(options: BrowserOptions)
| 111 | } |
| 112 | |
| 113 | function getDefaultIntegrations(options: BrowserOptions): Integration[] { |
| 114 | const customDefaultIntegrations = getReactDefaultIntegrations(options); |
| 115 | // This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", |
| 116 | // in which case everything inside will get tree-shaken away |
| 117 | if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { |
| 118 | customDefaultIntegrations.push(browserTracingIntegration()); |
| 119 | } |
| 120 | |
| 121 | // These values are injected at build time, based on the output directory specified in the build config. Though a default |
| 122 | // is set there, we set it here as well, just in case something has gone wrong with the injection. |
| 123 | const rewriteFramesAssetPrefixPath = |
| 124 | process.env._sentryRewriteFramesAssetPrefixPath || |
| 125 | globalWithInjectedValues._sentryRewriteFramesAssetPrefixPath || |
| 126 | ''; |
| 127 | const assetPrefix = process.env._sentryAssetPrefix || globalWithInjectedValues._sentryAssetPrefix; |
| 128 | const basePath = process.env._sentryBasePath || globalWithInjectedValues._sentryBasePath; |
| 129 | const experimentalThirdPartyOriginStackFrames = |
| 130 | process.env._experimentalThirdPartyOriginStackFrames === 'true' || |
| 131 | globalWithInjectedValues._experimentalThirdPartyOriginStackFrames === 'true'; |
| 132 | customDefaultIntegrations.push( |
| 133 | nextjsClientStackFrameNormalizationIntegration({ |
| 134 | assetPrefix, |
| 135 | basePath, |
| 136 | rewriteFramesAssetPrefixPath, |
| 137 | experimentalThirdPartyOriginStackFrames, |
| 138 | }), |
| 139 | ); |
| 140 | |
| 141 | return customDefaultIntegrations; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Just a passthrough in case this is imported from the client. |
no test coverage detected