-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Missing gzip information for HTML files in build logs output #11288
Comments
I'm not seeing the gzip size in Vite 3:
Here's Vite 4:
|
You’re right, indeed. I’ve checked on Vite 2 as well. Could it become a feature request? 👀 |
The problem is in the reporter.ts plugin: compressedSize: isCSS
? await getCompressedSize(chunk.source)
: null, This was introduced with 186f669 by @ArnaudBarre in #10895 I have no idea why the compressed size is only shown for css files. But this is the problem! |
This was already the case before: https://github.com/vitejs/vite/pull/10895/files?w=1#diff-804926239ab7ce5dd12d3ba02244733917a7a54582b67c8212e130679aa00508L194 I don't know if gzip size makes a lot of sense for non text assets like images. But we can definitely add this for more content type than CSS |
For non-test assets, it probably doesn’t make sense as server-side on-the-fly compression (like gzip or brotli) isn’t effective. It’s only great for text like XML (HTML and SVG), CSS, JS and JSON. |
Instead if a simple |
Let's discuss the exact list with the team on the PR. Let's add html, svg, txt, json for an initial PR. Ping me on the PR |
Describe the bug
On top of the uncompressed file size, Vite 3 displayed the gzip size for HTML, CSS, JS and (if I’m correct) SVG files.
The gzip size for HTML files is currently missing from Vite 4 build output. I think it should be included, as it’s a useful information.
Reproduction
https://github.com/meduzen/canwe/tree/vite-4
Steps to reproduce
Run
npm install
andnpm run build
.System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: