perf: load script only on pages where it is used
avi-agg opened this issue Β· comments
π Is your documentation request related to a problem?
By default the Script is being loaded on all pages. I want it to load on selected pages. How can I do that?,
π Where should you find it?
No response
βΉοΈ Additional context
No response
I think the plugin's functionality to load the script would need to be moved to the NuxtTurnstile
component. Before I say "pull request welcome" though, I'd like to ask @danielroe if there is any reason to keep the head extension in the plugin.
Yes, I think it would be nice to move it to the component, if we can implement it so it's deduplicated across components and also not removed from the head if the component is unmounted (as this could result in the script being loaded more than once).
That's great to hear... Can you create a pull request for it?
+1
I think this is a good task for a community PR, help welcome! π
@danielroe did #306 help to resolve this issue or is this unrelated?
yes, this should be resolved!