From c766e36b1ea46a809d4f1d9ac75734fb8bbf12cb Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sun, 25 Jan 2026 20:51:46 +0100 Subject: [PATCH] minimal serving size reduction by using hashed css classes --- svelte.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/svelte.config.js b/svelte.config.js index 02773ae..c8efd47 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -6,6 +6,11 @@ const config = { // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors preprocess: [vitePreprocess()], + compilerOptions: { + // Shorter CSS hash: "svelte-1abc123" (14 chars) → "abc12" (4 chars) + cssHash: ({ hash, css }) => `${hash(css).slice(0, 4)}` + }, + kit: { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // If your environment is not supported or you settled on a specific environment, switch out the adapter.