From 144f07ea7561e68f3a5f1ac3b05e64e6613bc301 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 16 Jan 2026 08:21:41 +1000 Subject: [PATCH] fix(ui): use tsc for declarations to avoid memory issues in CI The rollup-plugin-dts used by tsup runs out of memory with 54 entry points. Split build into two steps: 1. tsup for ESM bundles 2. tsc --emitDeclarationOnly for .d.ts files --- packages/ui/package.json | 2 +- packages/ui/tsup.config.ts | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index ebe7434..60383f1 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -240,7 +240,7 @@ "dist" ], "scripts": { - "build": "NODE_OPTIONS='--max-old-space-size=4096' tsup", + "build": "tsup && tsc --emitDeclarationOnly --declaration --outDir dist", "dev": "tsup --watch", "test": "vitest run", "test:ui": "vitest --ui", diff --git a/packages/ui/tsup.config.ts b/packages/ui/tsup.config.ts index 2d31e5a..b5533a1 100644 --- a/packages/ui/tsup.config.ts +++ b/packages/ui/tsup.config.ts @@ -47,13 +47,9 @@ entries.push('src/system/hooks/useDitherAnimation.ts'); export default defineConfig({ entry: entries, format: ['esm'], - dts: { - // Reduce memory usage in CI by disabling concurrent workers - // This prevents "JS heap out of memory" errors when building many components - compilerOptions: { - composite: false, - }, - }, + // DTS disabled - using tsc directly to avoid memory issues with rollup-plugin-dts + // See build script: "tsup && tsc --emitDeclarationOnly" + dts: false, clean: true, treeshake: false, // Disable treeshaking to preserve 'use client' splitting: false,