-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
41 lines (29 loc) · 1 KB
/
vite.config.ts
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
import {defineConfig} from "vite";
import Icons from "unplugin-icons/vite";
import {sveltekit} from "@sveltejs/kit/vite";
import {SvelteKitPWA} from "@vite-pwa/sveltekit";
import {readFileSync} from "node:fs";
import path from "node:path";
const manifestPath = path.join(__dirname, "static/manifest.json");
const pwaManifest = JSON.parse(readFileSync(manifestPath, {encoding: "utf8"}))!;
const certDirectory = "C:\\Certbot\\live\\appdev.jessamine.kyschools.us";
const keyFile = path.join(certDirectory, "privkey.pem");
const certFile = path.join(certDirectory, "fullchain.pem");
export default defineConfig(args => {
// don't read files unless we're actually in deployment
const preview = args.isPreview ? {
https: {
key: readFileSync(keyFile),
cert: readFileSync(certFile),
},
proxy: {} // this is needed for some ungodly reason but it fixes my headaches
} : undefined;
return {
plugins: [
sveltekit(),
SvelteKitPWA({...pwaManifest}),
Icons({compiler: "svelte"}),
],
preview
}
});