import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import { fileURLToPath } from "node:url"; const here = fileURLToPath(new URL(".", import.meta.url)); export default defineConfig({ plugins: [vue()], build: { target: "node22", outDir: "dist", emptyOutDir: true, minify: false, lib: { entry: `${here}src/main.ts`, formats: ["es"], fileName: () => "agent.mjs", }, rollupOptions: { external: (id) => !id.startsWith(".") && !id.startsWith("/") && !id.startsWith("\0"), }, }, });