Skip to content

Preload css only with getLinkTags #1031

@cjwiseman11

Description

@cjwiseman11

Hello 👋

Just curious if there's a "simple" way to get preload link tags for CSS only and not both JS and CSS tags?

Currently I'm using this approach:

  const cssLinkTags = extractor
    .getLinkTags()
    .split('\n')
    .filter(tag => tag.includes('as="style"'))
    .join('');

But it's not as nice as just using getLinkTags() for example - the problem with getLinkTags is it gives preload links for JS and CSS.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions