Skip to content

Sentry Adds TypeScript Source Files to Production Bundle #2789

@DouglasDev

Description

@DouglasDev

Package: @sentry/browser, version 5.20.1
Webpack configured by Create React App, using react-scripts version 3.4.1

Issue:
I'm trying to reduce my production bundle size by analyzing it with source-map-explorer.

With Sentry imported into my project, The node modules bundle includes several TypeScript source files. See the bottom of this image where it says "64.51 KB - 3.6%":
With Sentry

Looking inside that section of the bundle we see this:
TypeScript Files

I know these files are coming from Sentry because when I remove the Sentry import, the files are all gone:
without Sentry

I can't think of any reason why these files should be in the bundle output, and I'm not having this issue with any other packages I'm using. Any suggestions on how to remove these files from the bundle would be appreciated. Thanks.

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