Based on this https://docs.sentry.io/platforms/javascript/configuration/tree-shaking/, we should add flags to the bundler plugins to automatically shake out code you don't care about, something like:
sentryWebpackPlugin({
// other options...
stripDebugStatements: true,
stripRrwebCanvas: true,
stripRrwebIframe: true,
stripRrwebShadowDom: true
});
(naming TBD).
### Tasks
- [ ] Allow to strip debug statements (`__SENTRY_DEBUG__: false`)
- [ ] Allow to strip rrweb canvas capturing (`__RRWEB_EXCLUDE_CANVAS__`: true)
- [ ] Allow to strip rrweb iframe capturing (`__RRWEB_EXCLUDE_IFRAME__`: true)
- [ ] Allow to strip rrweb shadow dom capturing (`__RRWEB_EXCLUDE_SHADOW_DOM__`: true)