import { defineConfig } from "vite";
import { viteSingleFile } from "vite-plugin-singlefile";
import { resolve } from "path";

export default defineConfig({
  plugins: [viteSingleFile()],
  resolve: {
    alias: {
      "@components": resolve(__dirname, "../../components"),
      "@hooks": resolve(__dirname, "../../hooks"),
      "@styles": resolve(__dirname, "../../styles"),
      "@utils": resolve(__dirname, "../../utils"),
    },
  },
  build: {
    outDir: resolve(__dirname, "../../../dist/app-ui"),
    emptyOutDir: false,
    minify: "esbuild",
    target: "es2022",
  },
  esbuild: {
    jsx: "automatic",
    jsxImportSource: "react",
  },
});
