fix: server load interferes with spa

This commit is contained in:
2024-09-29 20:27:06 +02:00
parent ca8bfac3bc
commit 1d976947e1
5 changed files with 5 additions and 16 deletions

View File

@@ -1,12 +0,0 @@
import {
themeBase,
themeColor,
themeSuccessBase,
} from "$lib/style/theme.server";
import type { LayoutServerLoad } from "./$types";
export const load = (async () => ({
themeSuccessBase,
themeBase,
themeColor,
})) satisfies LayoutServerLoad;

View File

@@ -1,11 +1,14 @@
import type { LayoutLoad } from "./$types";
import { browser } from "$app/environment";
import { charaFileFromUriComponent } from "$lib/share/share-url";
import { themeBase, themeColor, themeSuccessBase } from "$lib/style/theme";
export const load = (async ({ url, data, fetch }) => {
const importFile = browser && new URLSearchParams(url.search).get("import");
return {
...data,
themeSuccessBase,
themeBase,
themeColor,
importFile: importFile
? await charaFileFromUriComponent(importFile, fetch)
: undefined,

View File

@@ -1,2 +0,0 @@
export const prerender = false;
export const ssr = false;

View File

@@ -1,5 +1,5 @@
// noinspection ES6PreferShortImport
import { themeColor } from "./src/lib/style/theme.server";
import { themeColor } from "./src/lib/style/theme";
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import { SvelteKitPWA } from "@vite-pwa/sveltekit";