- Issue created by @catch
- 🇫🇷France vbouchet
I understand that for now, given the example, it is to add the possibility to specify additional "things" with the library that would generate the link tags. What about the existing external / js that are added in a library?
Should we do something like:my_library: js: https://cdn.example.com/js/file.js: { type: external, preconnect: true, dns-prefech: true }
or
my_library: js: https://cdn.example.com/js/file.js: { type: external } links: - rel: preconnect href: //cdn.example.com - rel: dsn-prefetch href: //cdn.example.com
The second option allows a lot of flexibility (and cover the example of fonts) but is much more verbose.
Third option is a mix, allowing for shorter version for elements of the library (like example 1) and verbose version for other elements.I am curious of a direction as we are for now implementing custom on a project but would be keen to write a patch for this to land in core the proper way.
- 🇬🇧United Kingdom catch
I kind of like the more verbose option even for the same file, because you could have two files from the same CDN and then defining prefetch inline for one file (or both) doesn't seem ideal. We could always add a shorthand in a follow-up.