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
Option to be able to exclude preloads being injected into HTML #420
Comments
You'll be able to do that with #419 (comment). Also, we should adjust vps's default behavior: what assets does vps currently preload that you think shouldn't? |
I don't think images should be preloaded at all (you can use attributes like preloading JS seems to be Vite's default, but I disagree with that too, I think any preload should be opt-in, not opt-out vitejs/vite#3133 |
Why do you believe that? Happy to change my mind and with it vps's defaults. |
I suppose I'm looking at this from a website perspective over an 'app' perspective. The fact that HTML is pre-rendered, the hydration is secondary and shouldn't block the page load.. especially if people are using lazy load strategies for some modules (e.g. using intersection observer) |
I suppose the |
If the preload links are included at the end of the HTML, then I believe the initial render is not blocked by them. That's why, so far, I think the current default is correct. |
…com/injectPreloadAssets (closes #262, closes #419, closes #420, closes #510)
https://vite-plugin-ssr.com/preload Released in With that release, only font preload and modulepreload are injected by default. The rest is opt-in. In case your company is up for it: https://github.com/sponsors/brillout. |
Description
Preloading everything (JS, CSS, Image assets) is bad for performance. It would be nice to have an option to prevent these being injected into the HTML, either as global toggle or on a file extension/mim-type basis.
We are currently doing this as a "post-build" task on statically generated pages, but this is not suitable for pages generated via SSR.
The text was updated successfully, but these errors were encountered: