Problem Statement
Currently, if we use @sentry/browser or any similar package, but we don't use any replay feature (for any reason), we want to avoid shipping the whole replay package to our customers.
We use webpack and I setup a specific rule through resolve.alias configuration to resolve all occurrences of the replay package to null.
resolve: {
alias: {
'@sentry/replay': false
}
}
It works, and doesn't create any error, but it's not really "clean".
Solution Brainstorm
Offer a flag to let bundler choose similar to these https://docs.sentry.io/platforms/javascript/guides/react/configuration/tree-shaking/#list-of-flags
Tag: __SENTRY_REPLAY__
It would be much cleaner than a webpack resolve config.
Problem Statement
Currently, if we use
@sentry/browseror any similar package, but we don't use any replay feature (for any reason), we want to avoid shipping the whole replay package to our customers.We use webpack and I setup a specific rule through
resolve.aliasconfiguration to resolve all occurrences of the replay package to null.It works, and doesn't create any error, but it's not really "clean".
Solution Brainstorm
Offer a flag to let bundler choose similar to these https://docs.sentry.io/platforms/javascript/guides/react/configuration/tree-shaking/#list-of-flags
Tag:
__SENTRY_REPLAY__It would be much cleaner than a webpack resolve config.