Closed
Description
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, { includeWebReplay: true });
Metadata
Metadata
Assignees
Type
Projects
Status
Done
Status
No status