Intercept/Modify/Disable SvelteKit generated head elements #12816
Unanswered
glyndwr-io
asked this question in
Q&A
Replies: 1 comment
-
Okay, I think I've encountered a bug here and would appreciate a sanity check. According to the documentation, The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all :)
I'm working on an application that is very heavy on dynamically imported components. The current SSR behavior is to add a
<link>
element to the<head>
tag using%sveltekit.head%
. For statically imported components this works great for ensuring that all the right stylesheets are loaded in. For dynamic components however, it generally can't be known which component dynamically loads on the client side before the SSR'ed response is sent, so it just includes all possible stylesheets. For applications low on Dynamically imported components this works fine, however my application is unique in that it is heavily reliant on dynamic imports and there will be hundreds if not thousands of possible stylesheets that need to be included as<link>
elements in the<head>
tag. My usecase is also unqiue in that I can know at SSR time which dynamic component needs to be loaded, and as such I have my own way of managing these imports. My question is how I would go about Intercepting/Modifying/Disabling the%sveltekit.head%
generation so that instead of including all possible stylesheets for dynamically imported components, it includes none of them. I'm specifically referencing this behavior.Any insight would be greatly appreciated, this is my first time really diving into the gritty details of how SK works.
Beta Was this translation helpful? Give feedback.
All reactions