presseportale/vite.portal.config.js
Kevin Adametz 5b8bdf4182
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
12-05-2026 Frontend dev
2026-05-12 18:32:33 +02:00

56 lines
1.6 KiB
JavaScript

/**
* Vite-Konfiguration für Backend (Portal)
* - Domain: presseportale.test
* - Port: 5177
* - Verwendet FluxUI
* - Build-Verzeichnis: public/build/portal
*
* Starten mit: npm run dev:portal
*/
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import tailwindcss from "@tailwindcss/vite";
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.presseportale.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,
},
},
},
});