loadable-components icon indicating copy to clipboard operation
loadable-components copied to clipboard

Preload css only with getLinkTags

Open cjwiseman11 opened this issue 6 months ago • 0 comments

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

cjwiseman11 avatar Oct 14 '25 11:10 cjwiseman11