fix(module): preload global fonts#856
Conversation
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGlobal font processing now determines preload eligibility through a shared Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The failing
|
Resolves #834
What
Global fonts (
global: true) are never preloaded, even withpreload: trueset.Why
The normal font-preload path runs through
shouldPreload, which feeds intofontMapand finally intobuild:manifest. Thenuxt-fonts-global.csstemplate, however, only generates the@font-facerule and skips this process entirely, so global fonts never enter the preload map.How
I extracted
shouldPreloadinto a shared function and collect the top-priority font intofontMap, using the font-family name as the key. This letsbuild:manifestcorrectly attach the font to the entry chunk. As a result, global fonts are preloaded as expected.Testing
I verified the issue is fixed in a production build, and the existing snapshot now includes
/font-global.woff2.