diff --git a/packages/ui/package.json b/packages/ui/package.json index 85d7bf0..da614c6 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -92,7 +92,7 @@ "dist" ], "scripts": { - "build": "tsup", + "build": "NODE_OPTIONS='--max-old-space-size=4096' tsup", "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 dda9aee..35bd31b 100644 --- a/packages/ui/tsup.config.ts +++ b/packages/ui/tsup.config.ts @@ -33,7 +33,13 @@ const entries = allFiles.filter((file) => { export default defineConfig({ entry: entries, format: ['esm'], - dts: true, + 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, + }, + }, clean: true, treeshake: true, splitting: false, @@ -41,4 +47,6 @@ export default defineConfig({ esbuildOptions(options) { options.jsx = 'automatic'; }, + // Reduce bundle size by minifying in production + minify: process.env.NODE_ENV === 'production', });