Skip to content

The open alternative to Salesforce, designed for AI.

Bundle tabler icons into twenty-ui's individual build (#29384)

Félix Malfait8c2e809b6274
diff --git a/packages/twenty-ui/vite.config.individual.ts b/packages/twenty-ui/vite.config.individual.ts
index a8a36d82ba6..b7132b3ba4d 100644
--- a/packages/twenty-ui/vite.config.individual.ts
+++ b/packages/twenty-ui/vite.config.individual.ts
@@ -7,10 +7,13 @@ import svgr from 'vite-plugin-svgr';
import { wrapInTwentyUiCascadeLayer } from './build-tools/wrapInTwentyUiCascadeLayer';
import packageJson from './package.json';
+// bundled so consumers only parse the icons twenty-ui uses, not the 6,000-module barrel
+const BUNDLED_DEPS = ['@tabler/icons-react'];
+
const depNames = Object.keys({
...(packageJson.dependencies || {}),
...(packageJson.peerDependencies || {}),
-});
+}).filter((dep) => !BUNDLED_DEPS.includes(dep));
const isExternal = (id: string): boolean =>
depNames.some((dep) => id === dep || id.startsWith(dep + '/'));