import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@fn_library": path.resolve(__dirname, "../../../frontend/functions"),
    },
  },
  server: {
    port: 5180,
    proxy: {
      "/api": {
        target: "http://localhost:8095",
        ws: true,
        changeOrigin: true,
      },
    },
  },
  build: {
    outDir: "../backend/dist",
    emptyOutDir: true,
  },
});
