Files
Termix/vite.config.ts
T

35 lines
841 B
TypeScript
Raw Normal View History

2025-09-12 14:42:00 -05:00
import path from "path";
2025-10-01 15:40:10 -05:00
import fs from "fs";
2025-09-12 14:42:00 -05:00
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
+7
2025-11-05 10:36:16 -06:00
import react from "@vitejs/plugin-react";
2025-08-07 02:20:27 -05:00
2025-10-01 15:40:10 -05:00
const sslCertPath = path.join(process.cwd(), "ssl/termix.crt");
const sslKeyPath = path.join(process.cwd(), "ssl/termix.key");
const hasSSL = fs.existsSync(sslCertPath) && fs.existsSync(sslKeyPath);
const useHTTPS = process.env.VITE_HTTPS === "true" && hasSSL;
2025-08-07 02:20:27 -05:00
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
2025-09-12 14:42:00 -05:00
base: "./",
2025-10-01 15:40:10 -05:00
build: {
sourcemap: false,
},
server: {
https: useHTTPS
? {
cert: fs.readFileSync(sslCertPath),
key: fs.readFileSync(sslKeyPath),
}
: false,
port: 5173,
host: "localhost",
},
2025-09-12 14:42:00 -05:00
});