Skip to content

The open-source app everyone uses to manage agents at work

chore(ui): drop console.* and legal comments in production builds (#3728)

Jannes Stubbemann390502736c32
diff --git a/ui/vite.config.ts b/ui/vite.config.ts
index 395eebb9d3..a680f60730 100644
--- a/ui/vite.config.ts
+++ b/ui/vite.config.ts
@@ -3,8 +3,18 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
-export default defineConfig({
+export default defineConfig(({ mode }) => ({
plugins: [react(), tailwindcss()],
+ build: {
+ minify: "esbuild",
+ },
+ esbuild:
+ mode === "production"
+ ? {
+ drop: ["console", "debugger"],
+ legalComments: "none",
+ }
+ : undefined,
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
@@ -22,4 +32,4 @@ export default defineConfig({
},
},
},
-});
+}));