coolify/vite.config.js
Andras Bacsai dcd325dc44 feat(v5): add Inertia app shell with Flux health
Adds v5 routing, middleware, home page rendering, team context sharing,
project model/table support, and Flux health reporting. Installs Flux in
container builds with role-aware s6 services and documents runtime roles.
2026-06-15 23:09:49 +02:00

48 lines
1.5 KiB
JavaScript

import { defineConfig, loadEnv } from "vite";
import laravel from "laravel-vite-plugin";
import react from "@vitejs/plugin-react";
import inertia from "@inertiajs/vite";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const viteHost = env.VITE_HOST || null;
const vitePort = Number(env.VITE_PORT || 5173);
return {
server: {
watch: {
ignored: [
"**/dev_*_data/**",
"**/storage/**",
],
},
host: "0.0.0.0",
allowedHosts: true,
cors: {
origin: [
/^https?:\/\/localhost(:\d+)?$/,
/^https?:\/\/127\.0\.0\.1(:\d+)?$/,
/^https?:\/\/\[::1\](:\d+)?$/,
...(env.APP_URL ? [env.APP_URL] : []),
...(viteHost ? [`http://${viteHost}:${vitePort}`, `https://${viteHost}:${vitePort}`] : []),
],
},
origin: viteHost ? `http://${viteHost}:${vitePort}` : undefined,
hmr: viteHost
? { host: viteHost, clientPort: vitePort }
: true,
},
plugins: [
laravel({
input: [
"resources/css/app.css",
"resources/js/app.js",
"resources/js/v5/app.jsx",
],
refresh: true,
}),
inertia({ ssr: false }),
react(),
],
}
});