import { defineConfig } from "vite";
import solid from "vite-plugin-solid";
import tailwindcss from "@tailwindcss/vite";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export default defineConfig({
  plugins: [solid(), tailwindcss()],
  resolve: {
    alias: {
      "~": resolve(__dirname, "./src")
    }
  },
  server: {
    port: 5173,
    proxy: {
      "/api/auth": {
        target: "http://localhost:43001",
        changeOrigin: true
      }
    }
  },
  build: {
    target: "esnext"
  }
});
