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

Make filesize analysis match browserify bundling #7

Open
Raynos opened this issue Jul 31, 2013 · 5 comments
Open

Make filesize analysis match browserify bundling #7

Raynos opened this issue Jul 31, 2013 · 5 comments

Comments

@Raynos
Copy link
Contributor

Raynos commented Jul 31, 2013

It would be nice if the total size matches what browserify bundles too. Currently one of my files is 184kb vs 198kb where browserify produces an extra 14kb

browserify will add extra code to the bundle for the basic require emulation.

It will also add extra kb of padding around every module with it's function (require, module, exports) wrapping.

It also detects global usage of process and adds the process emulation to the bundle as well.

hughsk added a commit that referenced this issue Aug 2, 2013
Stats are now a bit closer to actual bundle size (#7)
hughsk added a commit that referenced this issue Aug 4, 2013
@hughsk
Copy link
Owner

hughsk commented Aug 4, 2013

@Raynos process and Buffer now get picked up and included (the latter is ~100kB so pretty significant), along with the require emulation.

Not sure how to handle the padding precisely though, if I understand correctly that can vary depending on the options passed to browserify - maybe that's better not included, given you still get results that reflect the proportions of the bundle being taken up by specific files?

Edit: would be interesting to know how much unaccounted space is left in your bundle now :)

@ForbesLindesay
Copy link

I prefer not accounting for the padding. Including the Buffer in file size makes it even more important to have a nodejs option.

@hughsk
Copy link
Owner

hughsk commented Aug 4, 2013

@ForbesLindesay Yup - that's coming up next :)

@ForbesLindesay
Copy link

cool :)

@mattdesl
Copy link

👍

I have a case where the total size shown is 303kb, whereas the same file after bundling is 198kb.

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

4 participants