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
This commit is contained in:
Ajax Davis 2026-01-16 08:21:41 +10:00
parent f0d271720c
commit 144f07ea75
2 changed files with 4 additions and 8 deletions

View file

@ -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",

View file

@ -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,