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

feat: add preconnect hint for Google Fonts stylesheet #85

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

kara
Copy link
Contributor

@kara kara commented Jun 8, 2022

This commit adds a resource
hint for the origin of the font stylesheet if the
preconnect option is enabled. This is necessary
because the font stylesheet and the font itself are
served from two separate origins and both should be pre-
connected.

See https://web.dev/font-best-practices/#preconnect-to-critical-third-party-origins for more information.

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #85 (89e5813) into master (21961e4) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #85   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           42        43    +1     
  Branches        13        13           
=========================================
+ Hits            42        43    +1     
Impacted Files Coverage Δ
src/module.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21961e4...89e5813. Read the comment docs.

Copy link
Contributor

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks! ❤️

src/module.ts Outdated Show resolved Hide resolved
test/basic.test.ts Outdated Show resolved Hide resolved
This commit adds a <link rel="preconnect" /> resource
hint for the origin of the font stylesheet if the
preconnect option is enabled. This is necessary
because the font stylesheet and the font itself are
served from two separate origins and both should be pre-
connected.

See https://web.dev/font-best-practices/#preconnect-to-critical-third-party-origins for more information.
@kara
Copy link
Contributor Author

kara commented Jun 8, 2022

@danielroe Thanks for the review! Comments should be addressed.

@danielroe danielroe merged commit bb8c6f2 into nuxt-modules:master Jun 8, 2022
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

Successfully merging this pull request may close these issues.

2 participants