Skip to content

[Bug]: Vite GoogleFonts injectTo not working when defer: true #73

@chunlampang

Description

@chunlampang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions