Coves frontend - a photon fork
1import auto from '@sveltejs/adapter-auto'
2import node from '@sveltejs/adapter-node'
3import staticAdapter from '@sveltejs/adapter-static'
4import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
5import bun from 'svelte-adapter-bun-next'
6
7/** @type {import('@sveltejs/kit').Config} */
8const config = {
9 // Consult https://kit.svelte.dev/docs/integrations#preprocessors
10 // for more information about preprocessors
11 preprocess: vitePreprocess(),
12
13 kit: {
14 // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
15 // If your environment is not supported or you settled on a specific environment, switch out the adapter.
16 // See https://kit.svelte.dev/docs/adapters for more information about adapters.
17 adapter:
18 process.env.ADAPTER == 'static'
19 ? staticAdapter({
20 fallback: 'app.html',
21 precompress: true,
22 })
23 : process.env.ADAPTER == 'node'
24 ? node()
25 : process.env.ADAPTER == 'bun'
26 ? bun({
27 out: 'build',
28 precompress: {
29 brotli: true,
30 gzip: true,
31 },
32 })
33 : auto(),
34 alias: {
35 'mono-svelte': 'src/lib/ui/shared',
36 'svelte-hero-icons': 'node_modules/@xylightdev/svelte-hero-icons',
37 $comp: 'src/lib/components',
38 },
39 csp: {
40 directives: {
41 'script-src': ['self'],
42 },
43 // must be specified with either the `report-uri` or `report-to` directives, or both
44 reportOnly: {
45 'script-src': ['self'],
46 'report-uri': ['/'],
47 },
48 },
49 },
50}
51
52export default config