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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: load script only on pages where it is used #288

Open
avi-agg opened this issue Dec 2, 2023 · 5 comments
Open

perf: load script only on pages where it is used #288

avi-agg opened this issue Dec 2, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@avi-agg
Copy link

avi-agg commented Dec 2, 2023

馃摎 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

@avi-agg avi-agg added the documentation Improvements or additions to documentation label Dec 2, 2023
@dargmuesli dargmuesli added enhancement New feature or request good first issue Good for newcomers and removed documentation Improvements or additions to documentation labels Dec 5, 2023
@dargmuesli dargmuesli changed the title Scope module loading perf: load script only on pages where it is used Dec 5, 2023
@dargmuesli
Copy link
Collaborator

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.

@danielroe
Copy link
Collaborator

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).

@avi-agg
Copy link
Author

avi-agg commented Dec 8, 2023

That's great to hear... Can you create a pull request for it?

@lucasuracosta

This comment was marked as spam.

@dargmuesli dargmuesli added the help wanted Extra attention is needed label Dec 12, 2023
@dargmuesli
Copy link
Collaborator

I think this is a good task for a community PR, help welcome! 馃檶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants