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

export default defineConfig({
  plugins: [react(), svgr(), dts()],
  build: {
    sourcemap: "hidden",
    lib: {
      entry: resolve(__dirname, "./src/main.ts"),
      name: "Boundary Web UI Kit",
      fileName: "boundary-web-ui-kit",
    },
    rollupOptions: {
      external: ["react", "react-dom/client", "react/jsx-runtime", "react-dom"],
      output: {
        globals: {
          react: "react",
        },
      },
    },
  },
});
