-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
71 lines (56 loc) · 1.26 KB
/
svelte.config.js
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
64
65
66
67
68
69
70
71
// #region Imports
/*
https://kit.svelte.dev/docs/adapters
Import the correct adapter for Node servers
*/
import adapter from "@sveltejs/adapter-node"
/*
https://kit.svelte.dev/docs/integrations#preprocessors
Import preprocessor to allow the use of scss
*/
import sveltePreprocess from "svelte-preprocess"
// #endregion
/*
https://kit.svelte.dev/docs/configuration
Define Svelte config
*/
/** @type {import("@sveltejs/kit").Config} */
const config = {
preprocess: [
sveltePreprocess()
],
kit: {
adapter: adapter({
// The directory to build the Node server
out: "build",
// Prefix for environment variables used by the Node server
envPrefix: "NODE_SERVER_",
}),
// Paths to various files / directories
files: {
lib: "src/lib"
},
// The directory for SvelteKit to write temp files and cache
outDir: ".svelte-kit",
env: {
/*
Prefix for environment variables that are safe/unsafe
to expose client-side
*/
publicPrefix: "PUBLIC_",
privatePrefix: ""
},
// Prevent scripts loading from external sites, stopping XSS attacks
csp: {
mode: "auto",
directives: {
"script-src": ["self"]
}
},
// Check origin of requests, stopping CSRF attacks
csrf: {
checkOrigin: true
}
}
}
export default config