You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use several fonts in the project. Most of it is use in .svelte file, they automatically receive hash in the name (for example OpenSans-Bold.wA2Nybjk.woff2) after build, they're fine.
For optimization font loading one main font should be in <head>. This is a known and useful optimization, it is important that the <link rel="preload"> and <style> is exactly in <head>, not in JavaScript. Something like:
OpenSans-Regular.woff2 in static\fonts in this case.
This work, but after build OpenSans-Regular.woff2 not get hash in the name. This is correct behavior for files from static.
Have an opportunity in <head> use file from src folder and generate hash name for this file?
If just put OpenSans-Regular.woff2 in src and use url("./fonts/OpenSans-Regular.woff2") there will be an error, SvelteKit will be try find OpenSans-Regular.woff2 in static\fonts.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
Use several fonts in the project. Most of it is use in
.svelte
file, they automatically receive hash in the name (for example OpenSans-Bold.wA2Nybjk.woff2) after build, they're fine.For optimization font loading one main font should be in
<head>
. This is a known and useful optimization, it is important that the<link rel="preload">
and<style>
is exactly in<head>
, not in JavaScript. Something like:OpenSans-Regular.woff2 in
static\fonts
in this case.This work, but after build OpenSans-Regular.woff2 not get hash in the name. This is correct behavior for files from
static
.Have an opportunity in
<head>
use file fromsrc
folder and generate hash name for this file?If just put OpenSans-Regular.woff2 in
src
and useurl("./fonts/OpenSans-Regular.woff2")
there will be an error, SvelteKit will be try find OpenSans-Regular.woff2 instatic\fonts
.Use SvelteKit 2.
Beta Was this translation helpful? Give feedback.
All reactions