Skip to content

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

@colinhowells

Description

@colinhowells

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions