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

Investigate Webpack bundle size discrepancy #8356

Open
jryans opened this issue Jan 31, 2019 · 7 comments
Open

Investigate Webpack bundle size discrepancy #8356

jryans opened this issue Jan 31, 2019 · 7 comments
Labels
T-Task Tasks for the team like planning X-Needs-Investigation Z-t3chguy

Comments

@jryans
Copy link
Collaborator

jryans commented Jan 31, 2019

On my local machine, running yarn build in riot-web produces a 4.6 MB bundle.js file. However, the official build for develop comes up with a 14 MB bundle.js file.

Why are they so different?

@jryans
Copy link
Collaborator Author

jryans commented Jan 31, 2019

A table of curious sizes:

Type bundle.js uncompressed size
Develop @ 3fad360f5fa2 14 MB
Staging 4.0 MB
Local yarn build 4.6 MB

@jryans
Copy link
Collaborator Author

jryans commented Jan 31, 2019

@ara4n pointed out that Develop doesn't minify builds, so I guess that explains the largest difference here. I'll keep this open to do a bit more digging on bundle size.

@lampholder lampholder added the T-Task Tasks for the team like planning label Feb 1, 2019
@jondavidjohn
Copy link

I built a tool to help you analyze webpack bundles for size regressions, and report them directly to GitHub PRs. It's free for open source, so it might be worth checking out and helpful in this scenario.

https://packtracker.io

image

@jryans
Copy link
Collaborator Author

jryans commented Mar 24, 2021

The bundles continue to grow:

Type vendors~init.js uncompressed size
Develop 18.83 MB
App 5.33 MB
Local yarn build 3.2 MB

Local yarn build continues to differ from app in some perplexing way. 🤔

@jryans
Copy link
Collaborator Author

jryans commented Mar 24, 2021

There's also #2498 as a historical similar issue, but that one sort of proscribes a particular change to make as well. Over here, I'd just like to know more about why things are so large, and review a variety of possible changes we might make.

@novocaine
Copy link
Contributor

novocaine commented Nov 9, 2021

I think this is because of differences in how we embed the original source when generating sourcemaps. This might be clearer after I cleaned up how this is decided in reaction to develop's bundle being so large that sentry wouldn't take the upload.

@novocaine
Copy link
Contributor

novocaine commented Nov 9, 2021

Now:

Type vendors~init.js uncompressed size webpack devtool
Develop 6.8 MB source-map
App 5.7 MB nosources-source-map
Local yarn build 3.3 MB nosources-source-map

Okay, I don't know why the local build is smaller than the size of prod .. it should be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning X-Needs-Investigation Z-t3chguy
Projects
None yet
Development

No branches or pull requests

6 participants