mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Fonts imported in a template module do not preload or preconnect when used in a template.js file. This PR adds a small fix and a e2e test. Co-authored-by: Zack Tanner <[email protected]>
15 lines
337 B
JavaScript
15 lines
337 B
JavaScript
import localFont from 'next/font/local'
|
|
|
|
const templateFont = localFont({ src: './template-font-nunito-sans.woff2' })
|
|
|
|
export default function Template({ children }) {
|
|
return (
|
|
<>
|
|
<p id="template-with-fonts" className={templateFont.className}>
|
|
{JSON.stringify(templateFont)}
|
|
</p>
|
|
{children}
|
|
</>
|
|
)
|
|
}
|