-
Notifications
You must be signed in to change notification settings - Fork 31
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
Feature request: skip if compressed content is larger than original #35
Comments
I think you can try vite-plugin-compression2. Because this project seem die. I had to reimplement a version :( |
Thanks for the tip! Does |
@vHeemstra Of course. size check By the way. |
I switched to your updated package! It is indeed faster. :) I just made a PR adding the feature to skip compression if the compressed file size is larger than (or equal to) to original file size. |
@vHeemstra Ok. i will review your code |
Add something like:
at:
vite-plugin-compression/packages/core/src/index.ts
Line 99 in 077eff3
To avoid deleting the original file if it will be skipped because of compressed size being larger, move these lines:
vite-plugin-compression/packages/core/src/index.ts
Lines 89 to 91 in 077eff3
after the suggested check code above.
See #36 for fix.
The text was updated successfully, but these errors were encountered: