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

Show gzip information for the resulting index.html file #70

Closed
mojoaxel opened this issue Mar 19, 2023 · 3 comments · Fixed by #71
Closed

Show gzip information for the resulting index.html file #70

mojoaxel opened this issue Mar 19, 2023 · 3 comments · Fixed by #71

Comments

@mojoaxel
Copy link
Contributor

It would be nice to also show gzip for the resulting index.html file.

For this to work first vitejs/vite#12485 needs to get merged.

Than we also need to allow reportCompressedSize to be true which is disabled at the moment.

I'll provide a PR for this!

@richardtallent
Copy link
Owner

Can you better explain the use case for this?

Turning it on won't break the plugin, but it does add a bit more delay in the build process, and I'm struggling to understand the situations where this information would be useful.

This plugin is designed for compiling a web app into a single (and uncompressed) HTML file, so you can open and run it from a file system directly.

Using this plugin to build a site that is served via a web server would normally be a bad idea, since it subverts all of the performance benefits that come from modern web servers and bundlers: parallel connections, partial caching, on-demand asset loading, not having to base64-encode binary assets, not having to block compilation and rendering until the whole page loads, etc.

I can imagine using it for some limited-capability embedded system web servers, like ESP8266WebServer, but those don't tend to support on-the-fly compression anyway.

@mojoaxel
Copy link
Contributor Author

mojoaxel commented Apr 1, 2023

I'm happy to explain!

As you expected, I'm deploying to a very limited embedded device. While one-the-fly compression is not supported, it looks like the embedded webserver can deliver pre-compressed assets. Because the flash memory is very limited I need to keep an eye on the the bundle size.

As I see it, the option reportCompressedSize does absolutely no harm to vite-plugin-singlefile. Users that don't want or need the gzip target size being reported can just disable the setting. Users like me that are interested in this information should be able to use it!

@richardtallent If you think it is necessary I can add a note to the README and advice users to disable reportCompressedSize which is on by default!?

richardtallent added a commit that referenced this issue Apr 2, 2023
…meter

fix(#70): add support for the reportCompressedSize parameter
@richardtallent
Copy link
Owner

Thanks, makes sense now, fixed in 0.13.5!

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

Successfully merging a pull request may close this issue.

2 participants