65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import laravel from "laravel-vite-plugin";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// SSL-Konfiguration - für Entwicklung ohne echte Zertifikate
|
|
const httpsConfig =
|
|
process.env.NODE_ENV === "production"
|
|
? {
|
|
// In Produktion: echte Zertifikate verwenden
|
|
key: process.env.SSL_KEY_PATH,
|
|
cert: process.env.SSL_CERT_PATH,
|
|
}
|
|
: false; // HTTP für Entwicklung, Traefik handhabt SSL
|
|
|
|
// Alle erlaubten Domains für Multi-Domain CORS
|
|
const allowedDomains = [
|
|
"https://portal.b2in.test",
|
|
"https://b2in.test",
|
|
"https://b2a.test",
|
|
"https://stileigentum.test",
|
|
"https://style2own.test",
|
|
"https://assets.b2in.test",
|
|
"http://portal.b2in.test",
|
|
"http://b2in.test",
|
|
"http://b2a.test",
|
|
"http://stileigentum.test",
|
|
"http://style2own.test",
|
|
"http://assets.b2in.test",
|
|
"http://localhost:5174",
|
|
];
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
laravel({
|
|
input: [
|
|
// Admin Bereich
|
|
"resources/css/portal.css",
|
|
// Web Theme CSS Dateien
|
|
"resources/css/web/shared-styles.css",
|
|
"resources/css/web/theme-b2in.css",
|
|
"resources/css/web/theme-b2a.css",
|
|
"resources/css/web/theme-stileigentum.css",
|
|
"resources/css/web/theme-style2own.css",
|
|
"resources/js/app.js",
|
|
],
|
|
refresh: [`resources/views/**/*`],
|
|
}),
|
|
tailwindcss(),
|
|
],
|
|
server: {
|
|
https: false,
|
|
host: "0.0.0.0",
|
|
port: 5174,
|
|
cors: {
|
|
origin: allowedDomains,
|
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
credentials: true,
|
|
},
|
|
hmr: {
|
|
host: "assets.b2in.test",
|
|
protocol: "wss",
|
|
},
|
|
origin: "https://assets.b2in.test",
|
|
},
|
|
});
|