sentry-react-native
sentry-react-native copied to clipboard
Converting to epub: Interrupted operation as its client disconnected
Description
Metro currently doesn't support tree shaking out of the box. And so all @sentry/* dependencies are included in the final bundle.
Some packages can be easily excluded using the metro resolver options:
Current solution
const config = {
resolver: {
resolveRequest: (context, moduleName, platform) => {
if (moduleName.includes('@sentry/replay')) {
return { type: 'empty' };
}
return context.resolveRequest(context, moduleName, platform);
},
},
};
Proposed solution
Sentry Metro config will automatically remove web replay for mobile platforms and expose an option to remove it for web builds.
const { withSentryConfig } = require('@sentry/react-native/metro');
const m = mergeConfig(getDefaultConfig(__dirname), config);
module.exports = withSentryConfig(m, { includeReplay: true });