preload fonts by default
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
According to https://github.com/sveltejs/kit/pull/4963, @Rich-Harris said we don't preload fonts by default because they may be imported but not used on a page. Though I'm not sure that's a great reason for us to not do it by default as that seems like the user has coded things incorrectly in that case
Describe the proposed solution
Maybe Vite could issue a warning for fonts that are imported, but never used if we really care about detecting that
Alternatives considered
No response
Importance
nice to have
Additional Information
Font preloading sometimes doesn't work before Vite 5. Fixed in https://github.com/vitejs/vite/pull/14297
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reading SvelteKit's font asset handling and the referenced Vite pull requests, then determine where the default preload behavior is configured. Done means the agreed default behavior is implemented and covered by tests for imported fonts that are used on a page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vite
- Domain
- performance, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100