presseportale/dev/config-vite/vite.portal.config.js
Kevin Adametz 405df0a122
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
first commit
2025-10-20 17:53:02 +02:00

48 lines
1.5 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,
}
: true; // Self-signed für Entwicklung
export default defineConfig({
plugins: [
laravel({
input: ["resources/css/portal.css", "resources/js/app.js"],
refresh: ["resources/views/portal/**/*.blade.php"],
}),
tailwindcss({
config: "./tailwind.portal.config.js",
}),
],
server: {
https: false, // Traefik übernimmt SSL, Vite läuft intern auf HTTP
cors: true,
host: "0.0.0.0",
port: 5174, // oder 5175
hmr: {
host: "assets.b2in.test", // oder assets-web.b2in.test
protocol: "wss", // Explizit wss für WebSocket Secure
// WICHTIG: Die 'port'-Angabe hier entfernen!
// Der Browser soll den Standard-Port (443) von Traefik nutzen.
},
// Das origin ist nicht mehr notwendig, da der HMR-Port wegfällt.
},
build: {
outDir: "public/build/portal",
assetsDir: "",
manifest: "manifest.json",
rollupOptions: {
output: {
manualChunks: undefined,
},
},
},
});