import path from "node:path";
import { fileURLToPath } from "node:url";

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

const rootDir = path.dirname(fileURLToPath(import.meta.url));

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@platform-types": path.resolve(rootDir, "../../packages/types/src/index.ts"),
      "@platform-config": path.resolve(rootDir, "../../packages/config/src/index.ts"),
      "@platform-shared": path.resolve(rootDir, "../../packages/shared/src/index.ts"),
      "@platform-llm": path.resolve(rootDir, "../../packages/llm/src/index.ts")
    }
  },
  server: {
    host: "0.0.0.0",
    port: 3000
  }
});
