Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggestion: allow other attributes in options besides async and defer #11

Open
colinhowells opened this issue Jul 25, 2023 · 0 comments

Comments

@colinhowells
Copy link

colinhowells commented Jul 25, 2023

A common use case with third-party libraries is they expect to have an id, something like

<script id="exampleScript123" src="https://example.com/somefile.js" async defer="defer"></script>

Sometimes data attributes are requested as well:

<script data-something="exampleData" src="https://example.com/somefile.js" async defer></script>

In these cases, I use svelte:head, but it would be nice to have this use case handled by this great tool ... if you'd like a PR maybe I can do one up for you.

loader([
    { type: 'script', url, options: { id: "exampleScript123", data-something: "exampleData" } }
  ], test, callback)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant