docs: show a reliable way to preload fonts#16424
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/a11f6b8b8e3b97d617e9c623a1a44ed39fdc17e5Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
|
71aaa0d to
80a6abe
Compare
|
Hmm. I wonder if we should provide a |
|
Agreed, that would remove both footguns this recipe works around. Deriving it from the path mostly works, though there are edge cases I found: dotted basenames like I think I can implement this. I'm very supportive of this. Happy to make a separate PR and fix this one for docs. |
80a6abe to
24c920b
Compare
24c920b to
a79a518
Compare
Depends on #16443.
The docs say to opt fonts into preloading with a
preloadfilter but not what to match against, so what everyone writes is a substring check against the hashed output path — svelte.dev's own hooks does this — which silently stops matching when the font is renamed.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits