Skip to content

Add options for treeshaking through build-time flags #425

@mydea

Description

@mydea

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions