asset-management/vite.config.js
vamsi.balaga 5b55bd267b fix: build files into static/ so /assets reloads
The /assets route shared its URL with Vite's assets/ build folder, so
nginx found a real folder with no index.html and answered 403 on reload
or a direct link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:59:28 +05:30

26 lines
882 B
JavaScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig(({ command }) => ({
// Relative base: frontgen places one artifact at any mount path and injects <base href>.
base: "./",
// Not "assets": the app has an /assets route, and nginx answers 403 for a real
// folder with no index.html, so reloading /asset-management/assets/ broke.
build: { assetsDir: "static" },
plugins: [react()],
server: {
port: 5173,
open: true,
// TEMP (dev only): lets the browser read /api/apps/531/rv-screens, which
// dev-apps.getzino.in blocks from localhost via CORS. Remove once the
// asset record view id is found.
proxy: {
"/zino-apps": {
target: "https://dev-apps.getzino.in",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/zino-apps/, ""),
},
},
},
}));