mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import { svelteMarkdownPreprocess } from '@immich/svelte-markdown-preprocess';
|
|
import adapter from '@sveltejs/adapter-static';
|
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
import dotenv from 'dotenv';
|
|
import { resolve } from 'node:path';
|
|
|
|
dotenv.config({ path: '../../.env' });
|
|
|
|
const staticFiles = new Set(['/favicon.ico', '/img/social-preview.png']);
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
extensions: ['.svelte', '.md'],
|
|
preprocess: [
|
|
svelteMarkdownPreprocess({
|
|
layouts: {
|
|
default: '$lib/components/BlogPage.svelte',
|
|
PrivacyPolicyPage: '$lib/components/PrivacyPolicyPage.svelte',
|
|
},
|
|
}),
|
|
vitePreprocess(),
|
|
],
|
|
kit: {
|
|
adapter: adapter(),
|
|
alias: {
|
|
$common: '../../common',
|
|
'$common/*': '../../common/*',
|
|
// TODO remove after $common is gone...
|
|
'@immich/ui': resolve('../../packages/ui/dist'),
|
|
},
|
|
prerender: {
|
|
handleHttpError: ({ path, message }) => {
|
|
if (staticFiles.has(path)) {
|
|
return;
|
|
}
|
|
|
|
// otherwise fail the build
|
|
throw new Error(message);
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|