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

File sizes before and after minification #31

Open
while0pass opened this issue Oct 4, 2018 · 7 comments
Open

File sizes before and after minification #31

while0pass opened this issue Oct 4, 2018 · 7 comments

Comments

@while0pass
Copy link

It would be great if filesize could show file sizes before and after minification (uglify, terser) and the percent points of compression as well.

@ritz078
Copy link
Owner

ritz078 commented Oct 4, 2018

makes sense.

@bisubus
Copy link

bisubus commented Oct 14, 2018

Can we opt out of minification in this case? I'm currently using rollup-plugin-filesize@2 because I'm already doing minification myself and need just original and gzipped size.

@ritz078 ritz078 reopened this Oct 14, 2018
@ritz078
Copy link
Owner

ritz078 commented Oct 14, 2018

@bisubus you can set showMinifiedSize to false.

@ritz078 ritz078 closed this as completed Apr 11, 2020
@brettz9
Copy link
Collaborator

brettz9 commented Apr 11, 2020

Note that the new merges, do something somewhat different. The new merges (with showBeforeSizes enabled) peek at the dist file before it is overwritten (and kind of presumes that the current output.file was not minified since it shows before/after of the various minifications), showing how much the file size has changed since the last release (if one hasn't already overwritten it since the last release such as by running this multiple times).

I think this issue wanted to see how much the current size of source is being shaved down.

I got confused by this myself when I saw this issue.

I plan to prepare another PR now, @ritz078 , to document showBeforeSizes as I realize that had not been documented (as has render).

@brettz9
Copy link
Collaborator

brettz9 commented Apr 11, 2020

Did you want to reopen this then, @ritz078 ?

@ritz078 ritz078 reopened this Apr 11, 2020
@brettz9
Copy link
Collaborator

brettz9 commented Apr 11, 2020

Was just thinking... If the new reporter option were changed to accept an array, and if the boxen implementation were relegated to being just another reporter (albeit a default one), people could choose what kind of console output they got as well as any additional badge creation, etc. (I can understand the appeal of boxen, as it is well-done, but to my taste, I'd like something more terse).

And all reporters (including the default) could be configured on what info to show--e.g., showing or not showing the sizes (or diffs) when the current config was set to be a minified build.

@brettz9
Copy link
Collaborator

brettz9 commented Apr 14, 2020

If it's ok, I'd like to submit a PR (as I may get a chance) which replaces render with an array of reporter--which will default to a single item array with the "boxen" reporter (to preserve past behavior except when the user had their own render method). Update: Submitted as #67.

I think this would also be more in line with the terminology used in nyc, mocha, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants