-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathsvelte.config.js
More file actions
60 lines (55 loc) · 2 KB
/
svelte.config.js
File metadata and controls
60 lines (55 loc) · 2 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
import adapter from "@sveltejs/adapter-node";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
compilerOptions: { experimental: { async: true } },
kit: {
experimental: {
remoteFunctions: true,
tracing: { server: true },
instrumentation: { server: true }
},
adapter: adapter(),
alias: {
$params: "./src/params",
$types: "./src/lib/types",
$db: "./src/db",
$constants: "./src/lib/server/constants",
$ctx: "./src/context",
$routes: "./src/routes"
},
csrf: {
trustedOrigins: ["https://cupcake.shiiyu.moe", "https://sky.shiiyu.moe", "http://localhost:5173", "http://localhost:4173", "http://localhost:3000", "http://localhost:8080"]
},
csp: {
mode: "auto",
directives: {
"script-src": ["self", "unsafe-inline"],
"style-src": ["self", "unsafe-inline", "https://fonts.googleapis.com"],
"img-src": ["self", "data:", "https://textures.minecraft.net", "http://localhost:8080", "https://cupcake.shiiyu.moe", "https://sky.shiiyu.moe", "https://nmsr.nickac.dev"],
"connect-src": ["self", "https://mowojang.matdoes.dev", "http://localhost:8080", "https://cupcake.shiiyu.moe", "https://sky.shiiyu.moe"],
"font-src": ["self", "https://fonts.gstatic.com"]
}
},
version: {
name: process.env.PUBLIC_COMMIT_HASH || Date.now().toString(),
// in ms
pollInterval: 1000 * 60 // 1 minute
}
},
// Hide build warnings from node_modules
onwarn: (warning, handler) => {
if (warning.filename?.includes("node_modules")) return;
handler(warning);
},
vitePlugin: {
// Can be removed once Svelte 6 is released, as `true` will be the default
dynamicCompileOptions({ _filename, _compileOptions }) {
return { runes: true };
}
}
};
export default config;