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

Inlining small scripts #94

Open
aminya opened this issue Mar 25, 2024 · 1 comment
Open

Inlining small scripts #94

aminya opened this issue Mar 25, 2024 · 1 comment

Comments

@aminya
Copy link

aminya commented Mar 25, 2024

I want to inline the small scripts (e.g. files that are under 1 KB) into my HTML. Vite (and Astro) create very small files for different components, which could be inlined instead to avoid the overhead of another HTTP request.

Is there a way to specify a size limit for the max threshold of inlining?

 [vite] dist/_astro/logo.De6d2APk.svg        0.46 kB  gzip:  0.26 kB
 [vite] dist/_astro/Component1.DRflpVO5.js   0.14 kB  gzip:  0.14 kB
 [vite] dist/_astro/Component2.DK5iz3Tl.js   0.74 kB  gzip:  0.45 kB
 [vite] dist/_astro/client.BhZioPRu.js       0.90 kB  gzip:  0.56 kB
 [vite] dist/_astro/solid.DJlj9KZv.js        10.03 kB  gzip:  4.19 kB
@Greenheart
Copy link
Contributor

Greenheart commented May 26, 2024

I think this issue could be closed as out of scope for this project, based on the following paragraph from the project README:

This is a single file plugin. As in, it creates one HTML file and no other files. Hence the name. So, this either will not work or will not be optimized for apps that require multiple "entry points" (HTML files). Please see issue #51 for details. Issues opened requesting multiple entry points will be closed as wontfix.

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

No branches or pull requests

2 participants