Preload fonts
ram-you opened this issue · comments
Ramzi Youssef commented
Hi,
I have a problem with preload fonts in a nuxt project.
As result, I would like to have something like that :
<link rel="preload" href="/_nuxt/fonts/5b23eeb.woff2" as="font" type="font/woff2" crossorigin>
..from my nuxt.config.js:
....
css: [
'~assets/css/tailwind.css',
'~assets/fonts/Ubuntu/index.css',
],
...
...
render: {
bundleRenderer: {
shouldPreload: (file, type) => {
if (type === 'font') return /.woff2/.test(file)
return ['script', 'style'].includes(type)
}
}
},
...
Can you help please? THANKS