Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry Adds TypeScript Source Files to Production Bundle #2789

Closed
DouglasDev opened this issue Jul 31, 2020 · 2 comments
Closed

Sentry Adds TypeScript Source Files to Production Bundle #2789

DouglasDev opened this issue Jul 31, 2020 · 2 comments

Comments

@DouglasDev
Copy link

DouglasDev commented Jul 31, 2020

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.

@DouglasDev DouglasDev changed the title Sentry adds TypeScript Source Files to Production Bundle Sentry Adds TypeScript Source Files to Production Bundle Jul 31, 2020
@DouglasDev
Copy link
Author

Should I add any extra info to make it easier to reproduce?

@HazAT
Copy link
Member

HazAT commented Oct 12, 2020

@DouglasDev I haven't checked this in detail but I am 99.9% sure we are not adding the TS files. You are using the source map navigator plugin which if your source maps are correct, points to the ts files instead of the complied js files.

@HazAT HazAT closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants