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

export default defineConfig({
  root: __dirname,
  publicDir: path.resolve(__dirname, "public"),
  build: {
    outDir: path.resolve(__dirname, "../../dist-agent-html"),
    emptyOutDir: true,
  },
  plugins: [react(), tailwindcss()],
  resolve: {
    alias: [
      {
        find: "@/agent-html",
        replacement: path.resolve(__dirname, "../../packages/agent-html/src"),
      },
      {
        find: "@example",
        replacement: path.resolve(__dirname, "src"),
      },
    ],
  },
})
