Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add rel=preload to improve lighthouse performance score #52

Open
hjujah opened this issue Aug 18, 2020 · 4 comments
Open

How to add rel=preload to improve lighthouse performance score #52

hjujah opened this issue Aug 18, 2020 · 4 comments

Comments

@hjujah
Copy link

hjujah commented Aug 18, 2020

I keep having this error in the lighthouse audits and I can't find a workaround for it:
Consider using to prioritize fetching resources that are currently requested later in page load.

Its dramatically decreasing the performance score, so i am wondering if there is a way to add the preload attribute somehow?

Here is what I have in my nuxt config atm:

webfontloader: {
      custom: {
          families: ['GarnettMedium-Regular', 'Staff-Medium', 'Staff-Regular'],
          urls: ['/fonts.css']
      }
 }

Any help would be highly appreciated! Thanks!

@hjujah
Copy link
Author

hjujah commented Aug 29, 2020

Any updates on this? Would be great to get any answer since the client is pushing us to fix that issue... :(

@mahapo
Copy link

mahapo commented Oct 6, 2020

+1
CC: @manniL @Developmint

@mahapo
Copy link

mahapo commented Oct 6, 2020

I fixed the issue with adding the link manually to "nuxt.config.js".

  head: {
	...,
    link: [
      {
        rel: "preload",
        as: "style",
        href: "/fonts.css",
      },
    ],
  },

@m-haziq
Copy link

m-haziq commented Jun 23, 2021

@mahapo This method doesn't load fonts for me. I am using Google fonts link on "nuxt": "^2.14.0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants