egoist / egoist/tsup

A hook that runs once after all builds have completed

Open
#777 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
274
PR merge metrics
No merged PRs in 30d

Description

## Current behavior

The `onSuccess` hook runs once for every build config. In this example, `./prepareNpmEntrypoints.sh` will run twice.

```ts
// tsup.config.ts
export default defineConfig([
{ /* ... */ },
{ /* ... */ },
]);
```

```bash
pnpm tsup --watch --onSuccess "./prepareNpmEntrypoints.sh"
```

## Feature request

A hook that runs once, when all of the builds have completed. This can be used, for instance, to run a script that patches up the build products in some way that's not possible to do _during_ the build.

Contributor guide

Open the contributing guide

Research direction

Start with the multi-config example in tsup.config.ts and run pnpm tsup --watch using the onSuccess command shown. Trace how the current hook is invoked for each build configuration, then determine where an all-builds-completed hook belongs; done means ./prepareNpmEntrypoints.sh runs once after the complete build set rather than once per configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.