2026-10-21 20:31:05 +03:30
|
|
|
import { fileURLToPath, URL } from "node:url";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
|
import { defineConfig, type ProxyOptions } from "vite";
|
|
|
|
|
|
|
|
|
|
// same paths nginx serves in production: /api → NestJS, /media → object storage bucket
|
|
|
|
|
const proxy: Record<string, ProxyOptions> = {
|
|
|
|
|
"/api": { target: "http://localhost:4000", changeOrigin: true },
|
2026-10-22 17:18:17 +03:30
|
|
|
// trailing slash: the media library page itself lives at /media
|
|
|
|
|
"/media/": {
|
2026-10-21 20:31:05 +03:30
|
|
|
target: "http://localhost:9000/imen-media",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (p) => p.replace(/^\/media/, ""),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [vue(), tailwindcss()],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
|
|
|
|
},
|
|
|
|
|
server: { port: 5173, proxy },
|
|
|
|
|
preview: { port: 5173, proxy },
|
|
|
|
|
});
|