unplugin-fonts
unplugin-fonts copied to clipboard
[Bug]: Vite GoogleFonts injectTo not working when defer: true
Demo URL
No response
What happened?
When defer is true, the tag injected to the html is always head-prepend.
Reproduction steps
import Unfonts from 'unplugin-fonts/vite'
Unfonts({
google: {
injectTo: 'head',
display: 'swap',
families: [
{ name: 'Inter', styles: 'wght@100;300;400;500;700;900' },
],
},
})
Relevant log output
No response
What browsers are you seeing the problem on?
No response
What is your operating system?
Windows
injectTo is missing here
https://github.com/cssninjaStudio/unplugin-fonts/blob/a7e66d594e2c7e0a2cccfed7c15a069ffebb96c1/src/loaders/google-fonts.ts#L81-L89
Merged