app: fix building

This commit is contained in:
Nikita Galaiko 2023-02-03 10:35:26 +01:00
parent bd558f4c20
commit bb98b5411d
No known key found for this signature in database
GPG Key ID: EBAB54E845BA519D
3 changed files with 14 additions and 4 deletions

View File

@ -1,10 +1,15 @@
import { writable } from "svelte/store";
import type { LayoutLoad } from "./$types";
import { projects } from "$lib";
import { building } from "$app/environment";
import type { Project } from "$lib/projects";
export const ssr = false;
export const prerender = true;
export const csr = true;
export const load: LayoutLoad = () => ({
projects: projects.store(),
export const load: LayoutLoad = async () => ({
// tauri apis require window reference which doesn't exist during ssr, so dynamic import here.
projects: building
? writable<Project[]>([])
: (await import("$lib/projects")).store(),
});

View File

@ -1,6 +1,8 @@
import { derived } from "svelte/store";
import type { PageLoad } from "./$types";
export const prerender = false;
export const load: PageLoad = async ({ parent, params }) => {
const { projects } = await parent();
return {

View File

@ -12,7 +12,10 @@ const config = {
}),
],
kit: {
adapter: staticAdapter(),
adapter: staticAdapter({
precompress: true,
strict: false,
}),
},
};