Files
beauty-bookings/vite.config.ts
elpatron 2e5bfdd879 Fix Tailscale Funnel host blocking issue
- Add specific allowedHosts configuration for Tailscale domains
- Configure both Vite server and Hono dev server to accept .ts.net hosts
- Add global middleware to Hono app for host acceptance
- Allow master11.warbler-bearded.ts.net and all .ts.net subdomains
2025-09-29 20:03:23 +02:00

39 lines
1.4 KiB
TypeScript

import devServer, { defaultOptions } from "@hono/vite-dev-server";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig, loadEnv } from "vite";
export default defineConfig(({ mode }) => {
if (process.env.QUESTS_INSIDE_STUDIO !== "true") {
// When app is run outside Quests, this ensure .env* files are loaded
// Removes need for VITE_ prefix in .env files for the server as well
const env = loadEnv(mode, process.cwd(), "");
process.env = env;
}
return {
server: {
host: "0.0.0.0",
port: 5173,
// Erlaube Zugriffe von beliebigen Hosts (lokal + Proxy/Funnel)
allowedHosts: ["localhost", "127.0.0.1", "master11.warbler-bearded.ts.net", ".ts.net"],
cors: true,
// Keine explizite HMR/Origin-Konfiguration, Vite-Defaults für localhost funktionieren am stabilsten
},
publicDir: "public",
plugins: [
tsconfigPaths(),
react(),
tailwindcss(),
devServer({
// Exclude client folder from server because we only client render and
// it interferes with image imports.
exclude: [/src\/client\/.*/, ...defaultOptions.exclude],
entry: "./src/server/index.ts",
// Allow all hosts for Tailscale Funnel
allowedHosts: ["localhost", "127.0.0.1", "master11.warbler-bearded.ts.net", ".ts.net"],
}),
],
};
});