Files
Folo/apps/mobile/metro.config.js
T
Innei 866abbef20 feat(sentry): integrate Sentry for error tracking and monitoring
- Added Sentry for error reporting in the mobile application.
- Updated the app configuration to initialize Sentry with the necessary DSN and settings.
- Replaced Firebase Crashlytics with Sentry for error capturing in the ErrorBoundary component.
- Updated various workflows to include Sentry authentication token.
- Adjusted dependencies to use React Native version 0.79.6 and updated related packages.

This integration enhances the application's ability to track and manage errors effectively.

Signed-off-by: Innei <tukon479@gmail.com>
2025-09-22 23:12:11 +08:00

49 lines
1.5 KiB
JavaScript

const { withNativeWind } = require("nativewind/metro")
const path = require("pathe")
const { wrapWithReanimatedMetroConfig } = require("react-native-reanimated/metro-config")
const { getSentryExpoConfig } = require("@sentry/react-native/metro")
const config = getSentryExpoConfig(__dirname, { isCSSEnabled: true })
config.resolver.sourceExts.push("sql")
config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
})
config.resolver.nodeModulesPaths = [
path.resolve(__dirname, "./node_modules"),
path.resolve(__dirname, "../../node_modules"),
]
config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
"@locales": path.resolve(__dirname, "../../locales"),
}
config.watchFolders = [...config.watchFolders, path.resolve(__dirname, "../../locales")]
config.resolver.resolveRequest = (context, moduleName, platform) => {
const result = context.resolveRequest(context, moduleName, platform)
if (result.type === "sourceFile") {
const lastDotIndex = result.filePath.lastIndexOf(".")
const mobilePath = `${result.filePath.slice(0, lastDotIndex)}.rn${result.filePath.slice(lastDotIndex)}`
const file = context.fileSystemLookup(mobilePath)
if (file.exists) {
return {
...result,
filePath: mobilePath,
}
} else {
return result
}
}
return result
}
module.exports = wrapWithReanimatedMetroConfig(
withNativeWind(config, { input: "./src/global.css" }),
)