egoist / egoist/tsup

parallel: false (or formatsInParallell: false)

Open
#912 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

One of Esbuild's Design principles is to Maximize parallelism
https://github.com/evanw/esbuild/blob/main/docs/architecture.md#design-principles

Which is great, and typically carries over into how people are writing esbuild plugins.

However when you use tsup and with build for multiple formats ['cjs', 'esm']: tsbuild runs the same esbuild-plugin, twice in parrallell.

I suspect esbuild-plugin developers don't image that happening, since they are developing for esbuild and not tsup.

I've run into a problem, because two copies of the same esbuild-plugin are writing to the same file, leading to a corrupt file:
https://github.com/jfortunato/esbuild-plugin-manifest/pull/14

Perhaps there should be a generic solution in tsup to prevent this from happening?

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Reproduce a tsup build with formats ['cjs', 'esm'] and the cited esbuild manifest plugin, then trace how plugin instances run for each format. Done means the behavior is defined and a generic solution prevents concurrent writes or clearly documents the required plugin behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.