-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsvelte.config.js
42 lines (38 loc) · 941 Bytes
/
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
import preprocess from "svelte-preprocess";
import adapter from "@sveltejs/adapter-node";
import * as fs from "fs";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter({ out: "build" }),
target: "#svelte",
router: true,
ssr: true,
hydrate: true,
trailingSlash: "never",
amp: false,
files: {
assets: "./assets",
hooks: "./app/hooks",
lib: "./app",
routes: "./app/pages",
serviceWorker: "./app/service-worker",
template: "./app/core/app.html"
}
}
};
// Add certificate if it's generated
if (fs.existsSync("localhost-key.pem") && fs.existsSync("localhost.pem")) {
config.kit.vite = {
server: {
https: {
key: fs.readFileSync("localhost-key.pem"),
cert: fs.readFileSync("localhost.pem")
}
}
};
}
export default config;