Plans on implementing Nuxt-fontaine?
StevenJPx2 opened this issue · 1 comments
Request Description
Nuxt Fontaine is a cool library that'll help with page load speeds by default by doing some magic with font metrics. It'll be cool if this library has it by default.
Alternative Solutions
None.
Additional Details
No response
Hi, thanks for the suggestion.
This module already uses methods for best performance when it comes to font loading.
The module automatically detects the configuration, depending on the strategy whether it is local
or external
, and adds preconnect and preload link tags in the head section with minified inline styles for the @font-face
rules.
This is all done by the minimal footprint so there is no additional code bloat. The module has only one dependency (for styling console logs) which is also under 1kb.
I just did some quick tests and here are the results:
Test environment
- Default nuxt-app project
nuxt-font-loader
with thelocal
strategy
// nuxt.config.ts
{
modules: ['nuxt-font-loader'],
fontLoader: {
local: [
{
src: '/fonts/AspektaVF.woff2',
family: 'Aspekta Variable',
weight: '100 900'
}
]
}
}
- Run
generate
andpreview
commands
So, in terms of page load speed, that's pretty much it.
As for your suggestion, I don't plan to implement it right now, I want to keep the module simple.
But just out of curiosity, have you had any performance or page load issues with this module?