Update Sentry to 8.x (#11147)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
// Learn more https://docs.expo.io/guides/customizing-metro
|
||||
import {type CustomResolver} from '@expo/metro/metro-resolver'
|
||||
import {getDefaultConfig} from '@expo/metro-config'
|
||||
import {getSentryExpoConfig} from '@sentry/react-native/metro.js'
|
||||
|
||||
const config = getSentryExpoConfig(import.meta.dirname, {
|
||||
// TODO: confirm this doesn't break anything when we switch to metro web
|
||||
includeWebReplay: false,
|
||||
annotateReactComponents: {
|
||||
textComponentNames: ['Text', 'ButtonText'],
|
||||
},
|
||||
getDefaultConfig: (projectRoot, options) => {
|
||||
const config = getDefaultConfig(projectRoot, options)
|
||||
|
||||
if (typeof process.env.RN_SRC_EXT === 'string') {
|
||||
// inject `.e2e.ts` and `.e2e.tsx` into the sourceExts when running tests)
|
||||
config.resolver.sourceExts.unshift(...process.env.RN_SRC_EXT.split(','))
|
||||
}
|
||||
|
||||
config.resolver.assetExts = [...config.resolver.assetExts, 'woff2']
|
||||
|
||||
if (config.resolver.resolveRequest) {
|
||||
throw Error('Update this override because it is conflicting now.')
|
||||
}
|
||||
|
||||
if (process.env.BSKY_PROFILE) {
|
||||
// @ts-expect-error readonly property
|
||||
config.cacheVersion += ':PROFILE'
|
||||
|
||||
const resolver: CustomResolver = (context, moduleName, platform) => {
|
||||
if (moduleName.endsWith('ReactNativeRenderer-prod')) {
|
||||
return context.resolveRequest(
|
||||
context,
|
||||
moduleName.replace('-prod', '-profiling'),
|
||||
platform,
|
||||
)
|
||||
}
|
||||
return context.resolveRequest(context, moduleName, platform)
|
||||
}
|
||||
|
||||
// @ts-expect-error readonly property
|
||||
config.resolver.resolveRequest = resolver
|
||||
}
|
||||
|
||||
config.transformer.getTransformOptions = () =>
|
||||
Promise.resolve({
|
||||
transform: {
|
||||
experimentalImportSupport: true,
|
||||
inlineRequires: true as false, // ??? typescript why?
|
||||
},
|
||||
})
|
||||
|
||||
return config as unknown as Record<string, unknown>
|
||||
},
|
||||
})
|
||||
|
||||
export default config
|
||||
Reference in New Issue
Block a user