Skip to content

Build hangs indefinitely with ~3000 unbundled entry files #696

@alexx855

Description

@alexx855

Reproduction link or steps

https://github.com/roninbuilders/contracts

git clone https://github.com/roninbuilders/contracts.git
cd contracts
pnpm install
pnpm run build

tsdown.config.ts:

import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['src/index.ts', 'src/contract.ts', 'src/contracts/**/*.ts'],
  format: ['esm', 'cjs'],
  dts: {
    isolatedDeclarations: true,
  },
  clean: true,
  minify: false,
  outDir: 'dist',
  unbundle: true,
})
  • tsdown: 0.19.0-beta.3
  • Node.js: v22.x
  • OS: Linux

What is expected?

Build completes and outputs ESM + CJS files to dist/.

The project has ~3000 entry files (auto-generated smart contract ABIs). With tsup, this build completes in ~27 seconds.

What is actually happening?

Build hangs indefinitely after displaying:

ℹ tsdown v0.19.0-beta.3 powered by rolldown v1.0.0-beta.58
ℹ config file: /home/alex/dev/contracts/tsdown.config.ts
ℹ entry: src/contract.ts, src/index.ts, src/contracts/...
ℹ target: node18.0.0
ℹ tsconfig: tsconfig.json
ℹ Build start
ℹ Cleaning 11877 files

The process never progresses past "Cleaning X files". CPU usage remains low, suggesting the process is blocked rather than doing intensive work.

Any additional comments?

Tested configurations (all hang):

Setting Values Tested
dts true, false, { isolatedDeclarations: true }
minify true, false
tsdown version 0.19.0-beta.2, 0.19.0-beta.3

The issue appears to be in the core build process, not DTS or minification, since disabling both doesn't resolve the hang.

Related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions