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";
|
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,
|
2026-01-02 00:33:10 -06:00
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks: {
|
2026-01-24 19:49:42 -06:00
|
|
|
"react-vendor": ["react", "react-dom"],
|
|
|
|
|
"ui-vendor": [
|
|
|
|
|
"@radix-ui/react-dialog",
|
|
|
|
|
"@radix-ui/react-dropdown-menu",
|
|
|
|
|
"@radix-ui/react-select",
|
|
|
|
|
"@radix-ui/react-tabs",
|
|
|
|
|
"@radix-ui/react-switch",
|
|
|
|
|
"@radix-ui/react-tooltip",
|
|
|
|
|
"@radix-ui/react-scroll-area",
|
|
|
|
|
"@radix-ui/react-separator",
|
|
|
|
|
"lucide-react",
|
|
|
|
|
"clsx",
|
|
|
|
|
"tailwind-merge",
|
|
|
|
|
"class-variance-authority",
|
|
|
|
|
],
|
|
|
|
|
monaco: ["monaco-editor"],
|
|
|
|
|
codemirror: [
|
|
|
|
|
"@uiw/react-codemirror",
|
|
|
|
|
"@codemirror/view",
|
|
|
|
|
"@codemirror/state",
|
|
|
|
|
"@codemirror/language",
|
|
|
|
|
"@codemirror/commands",
|
|
|
|
|
"@codemirror/search",
|
|
|
|
|
"@codemirror/autocomplete",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-01-02 00:33:10 -06:00
|
|
|
},
|
|
|
|
|
chunkSizeWarningLimit: 1000,
|
2025-10-01 15:40:10 -05:00
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
https: useHTTPS
|
|
|
|
|
? {
|
|
|
|
|
cert: fs.readFileSync(sslCertPath),
|
|
|
|
|
key: fs.readFileSync(sslKeyPath),
|
|
|
|
|
}
|
|
|
|
|
: false,
|
|
|
|
|
port: 5173,
|
|
|
|
|
host: "localhost",
|
|
|
|
|
},
|
2025-09-12 14:42:00 -05:00
|
|
|
});
|