presseportale/vite.web.config.js
Kevin Adametz 0efabaf446 Multi-Domain-Asset-Infrastruktur: geteilte Vite-Konfiguration und DomainAssetContext
- vite.shared.js als gemeinsame Quelle fuer Ports, Hot-Files, HMR-Hosts
  und CORS-Origins der beiden Vite-Builds (Portal/Web)
- App\Support\DomainAssetContext kapselt die Vite-Build-Directory-
  Konfiguration pro Domain (ThemeServiceProvider + Auth-Layout nutzen ihn)
- Tailwind-Portal-Content-Globs auf die tatsaechliche View-Struktur gezogen
- Dev-Beispiel-Routen + Tests (DomainAssetContextTest, DevExampleRoutesTest)
- Aufraeumen: versehentliche Leerdatei dev:web entfernt

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:16:09 +00:00

68 lines
1.8 KiB
JavaScript

/**
* Vite-Konfiguration für öffentliche Frontends (Web)
* - Domains: pressekonto.test (Hub), presseecho.test, businessportal24.test
* - Asset-Subdomains: assets.pressekonto.test, assets.presseecho.test, assets.businessportal24.test
* - Port: 5178
* - Build: public/build/web
*
* Backend/Admin auf pressekonto.test → vite.portal.config.js (dev:portal)
*
* Starten mit: npm run dev:web
*/
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import tailwindcss from "@tailwindcss/vite";
import {
WEB_ALLOWED_HOSTS,
WEB_CORS_ORIGINS,
WEB_HOT_FILE,
WEB_PORT,
createWatchIgnored,
webRefreshPaths,
webWatchDirs,
} from "./vite.shared.js";
export default defineConfig({
plugins: [
laravel({
input: [
"resources/css/web/theme-businessportal24.css",
"resources/css/web/theme-presseecho.css",
"resources/css/web/theme-pressekonto.css",
"resources/js/app.js",
],
refresh: webRefreshPaths,
hotFile: WEB_HOT_FILE,
}),
tailwindcss({
config: "./tailwind.web.config.js",
}),
],
server: {
https: false,
watch: {
ignored: createWatchIgnored(webWatchDirs),
},
cors: {
origin: WEB_CORS_ORIGINS,
credentials: true,
},
host: "0.0.0.0",
port: WEB_PORT,
strictPort: true,
allowedHosts: WEB_ALLOWED_HOSTS,
hmr: {
protocol: "wss",
},
},
build: {
outDir: "public/build/web",
assetsDir: "",
manifest: "manifest.json",
rollupOptions: {
output: {
manualChunks: undefined,
},
},
},
});