-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsvelte.config.js
More file actions
63 lines (54 loc) · 1.83 KB
/
svelte.config.js
File metadata and controls
63 lines (54 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import adapter from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
// Vercel adapter configuration
runtime: 'nodejs20.x',
regions: ['iad1'], // Default to US East (adjust based on your target audience)
split: false, // Set to true to deploy routes as individual functions
// Edge runtime configuration (uncomment to use Edge Functions)
// runtime: 'edge',
// regions: 'all', // Deploy to all edge regions
// Memory and execution limits
memory: 1024, // MB (256, 512, 1024, 3008)
maxDuration: 10 // seconds (max execution time)
}),
// Alias configuration for cleaner imports
alias: {
$components: 'src/lib/components',
$lib: 'src/lib',
$utils: 'src/lib/utils',
$services: 'src/lib/services',
$helper: 'src/lib/helper'
},
// Disable CSRF origin checking for the webhook route so Ko-fi's server-to-server
// POST requests (which have no matching Origin header) are not rejected.
csrf: {
trustedOrigins: ['*']
},
// Prerender configuration
prerender: {
handleHttpError: 'warn',
handleMissingId: 'warn',
entries: ['*'] // Prerender all discoverable pages
},
// CSP configuration for security
csp: {
mode: 'auto',
directives: {
'default-src': ['self'],
'script-src': ['self', 'unsafe-inline', 'https://analytics.ewancroft.uk'],
'style-src': ['self', 'unsafe-inline', 'https://fonts.googleapis.com'],
'style-src-elem': ['self', 'unsafe-inline', 'https://fonts.googleapis.com'],
'img-src': ['self', 'data:', 'https:'],
'font-src': ['self', 'data:', 'https://fonts.gstatic.com'],
'connect-src': ['self', 'https:'],
'media-src': ['self', 'https:']
}
}
}
};
export default config;