2024-09-18 14:11:47 +00:00
|
|
|
import "dotenv/config";
|
|
|
|
import adapter from "@sveltejs/adapter-static";
|
|
|
|
|
|
|
|
import { mdsvex } from "mdsvex";
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { dirname, join } from "node:path";
|
|
|
|
import { sveltePreprocess } from "svelte-preprocess";
|
2024-06-13 09:32:17 +00:00
|
|
|
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
|
|
const config = {
|
|
|
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
|
|
// for more information about preprocessors
|
2024-06-29 17:58:00 +00:00
|
|
|
extensions: [".svelte", ".md"],
|
|
|
|
preprocess: [
|
2024-09-07 15:57:53 +00:00
|
|
|
{
|
|
|
|
name: "strip-announcer",
|
|
|
|
markup: ({ content: code }) => {
|
|
|
|
code = code.replace(
|
|
|
|
/<div id="svelte-announcer" [\s\S]*?<\/div>/,
|
|
|
|
'<svelte:component this={null} />'
|
|
|
|
);
|
|
|
|
|
|
|
|
return { code }
|
|
|
|
}
|
|
|
|
},
|
2024-07-21 10:06:16 +00:00
|
|
|
sveltePreprocess(),
|
2024-06-29 17:58:00 +00:00
|
|
|
mdsvex({
|
|
|
|
extensions: ['.md'],
|
2024-09-17 18:54:28 +00:00
|
|
|
layout: {
|
|
|
|
about: join(
|
|
|
|
dirname(fileURLToPath(import.meta.url)),
|
|
|
|
'/src/components/misc/AboutPageWrapper.svelte'
|
|
|
|
),
|
|
|
|
changelogs: join(
|
|
|
|
dirname(fileURLToPath(import.meta.url)),
|
|
|
|
'/src/components/changelog/ChangelogEntryWrapper.svelte'
|
|
|
|
)
|
|
|
|
}
|
2024-06-29 17:58:00 +00:00
|
|
|
})
|
|
|
|
],
|
2024-06-13 09:32:17 +00:00
|
|
|
kit: {
|
2024-06-24 14:23:55 +00:00
|
|
|
adapter: adapter({
|
|
|
|
// default options are shown. On some platforms
|
|
|
|
// these options are set automatically — see below
|
|
|
|
pages: 'build',
|
|
|
|
assets: 'build',
|
2024-09-03 13:38:07 +00:00
|
|
|
fallback: '404.html',
|
2024-06-24 14:23:55 +00:00
|
|
|
precompress: false,
|
|
|
|
strict: true
|
|
|
|
}),
|
2024-09-18 14:11:47 +00:00
|
|
|
csp: {
|
|
|
|
mode: "hash",
|
|
|
|
directives: {
|
|
|
|
"connect-src": ["*"],
|
|
|
|
"default-src": ["none"],
|
|
|
|
|
|
|
|
"font-src": ["self"],
|
|
|
|
"style-src": ["self", "unsafe-inline"],
|
2024-09-23 09:30:31 +00:00
|
|
|
"img-src": ["*", "data:"],
|
2024-09-18 14:11:47 +00:00
|
|
|
"manifest-src": ["self"],
|
|
|
|
"worker-src": ["self"],
|
|
|
|
|
|
|
|
"object-src": ["none"],
|
|
|
|
"frame-src": [
|
|
|
|
"self",
|
|
|
|
"challenges.cloudflare.com"
|
|
|
|
],
|
|
|
|
|
|
|
|
"script-src": [
|
|
|
|
"self",
|
|
|
|
"wasm-unsafe-eval",
|
|
|
|
"challenges.cloudflare.com",
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
process.env.WEB_PLAUSIBLE_HOST ? process.env.WEB_PLAUSIBLE_HOST : "",
|
|
|
|
|
|
|
|
// hash of the theme preloader in app.html
|
|
|
|
"sha256-g67gIjM3G8yMbjbxyc3QUoVsKhdxgcQzCmSKXiZZo6s=",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2024-09-09 15:11:08 +00:00
|
|
|
env: {
|
|
|
|
publicPrefix: 'WEB_'
|
|
|
|
},
|
2024-07-23 10:04:43 +00:00
|
|
|
version: {
|
|
|
|
pollInterval: 60000
|
|
|
|
},
|
2024-07-07 16:10:12 +00:00
|
|
|
paths: {
|
|
|
|
relative: false
|
|
|
|
},
|
2024-06-24 14:23:55 +00:00
|
|
|
alias: {
|
2024-07-02 18:16:03 +00:00
|
|
|
$components: 'src/components',
|
|
|
|
$i18n: 'i18n',
|
2024-06-24 14:23:55 +00:00
|
|
|
}
|
|
|
|
}
|
2024-06-13 09:32:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|