Open ram-you opened 5 years ago
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>
<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
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:
Can you help please? THANKS