mirror of
https://github.com/immich-app/immich.git
synced 2025-11-23 23:00:42 +09:00
feat: preload fonts (#13068)
This commit is contained in:
12
web/src/hooks.server.ts
Normal file
12
web/src/hooks.server.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import overpass from '$lib/assets/fonts/overpass/Overpass.ttf?url';
|
||||
import overpassMono from '$lib/assets/fonts/overpass/OverpassMono.ttf?url';
|
||||
import type { Handle } from '@sveltejs/kit';
|
||||
|
||||
// only used during the build to replace the variables from app.html
|
||||
export const handle = (async ({ event, resolve }) => {
|
||||
return resolve(event, {
|
||||
transformPageChunk: ({ html }) => {
|
||||
return html.replace('%app.font%', overpass).replace('%app.monofont%', overpassMono);
|
||||
},
|
||||
});
|
||||
}) satisfies Handle;
|
||||
Reference in New Issue
Block a user