-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
34 lines (32 loc) · 875 Bytes
/
vite.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
import { defineConfig } from 'vite';
import tailwindcss from 'tailwindcss';
import { readFileSync } from 'fs';
import dotenv from 'dotenv';
dotenv.config();
let serverOptions = {};
let mode = process.env.NODE_ENV === "development" ? "development" : "production";
if (mode == "development") {
// Custom HTTPS server for development
// SSL Certificate is generated locally to trust the localhost
serverOptions = {
server: {
port: 443,
https: {
key: readFileSync(
process.env.HTTPS_CERTIFICATE_KEY_FILENAME_PATH,
"ascii"
),
cert: readFileSync(
process.env.HTTPS_CERTIFICATE_FILENAME_PATH,
"ascii"
),
}
},
}
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [tailwindcss()],
...serverOptions,
// manifest: true, // uncomment for PWA support
})