-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support for also displaying Brotli compressed size #47
Add support for also displaying Brotli compressed size #47
Conversation
81dadf6
to
8fd0b7e
Compare
Why not let the user display both if they want to? |
Yes, that would be better of course. To be honest, it is because of my very limited skills with javascript and promises. I'll have a look at it. |
8fd0b7e
to
af4cb57
Compare
I've done an attempt at letting the user show uncompressed, gzip and brotli size in any combination. However, there seems to be some issues with the tests that rely on the
|
af4cb57
to
670b04c
Compare
670b04c
to
23770f6
Compare
Sorry, that was me following a red herring. Fixed. |
index.js
Outdated
|
||
function addPropWise(a, b) { | ||
// eslint-disable-next-line guard-for-in | ||
for (const k in b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a for-of
loop.
And use descriptive variable/function names. No abbreviations.
index.js
Outdated
fancyLog(title + what + ' ' + strings.join(chalk.magenta(', '))); | ||
} | ||
|
||
function addPropWise(a, b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a better name.
index.js
Outdated
let fileCount = 0; | ||
const totalSize = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generally better to use a Map
for this.
Have you manually verified that all combinations of the options work correctly? |
No, I've just tried a few combinations. I guess the proper thing would be to add a couple of tests. |
Co-authored-by: Sindre Sorhus <[email protected]>
Speaking of which, I tried to test some more cases, and found something that I couldn't explain, which is also present in the original as well. In streaming mode, I can't manage to see that the data of the stream is actually piped on. The error could of course lie on my side. For example, by modifying the test 'should handle stream contents' (and here I'm a bit on shaky ground), the second gulp-size invocation reports a size of 0.
|
I don't know, TBH. I haven't worked on this package for a long time. |
Regarding the issue mentioned above, it seems to be related to gulpjs/gulp#2380. I moved the callback (in the original gulp-size) from |
Sorry, it seems brotli-size requires node >= 10.16. |
As the title says. It seems to be gaining ground, maybe someone else also will profit from such an option.