egoist / egoist/tsup

devDependencies are bundled even if they are in peerDependencies as well

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

Description

According to the readme:

> By default tsup bundles all import-ed modules but `dependencies` and `peerDependencies` in your package.json are always excluded.

So, I would think that if peerDependencies are always excluded, then if I specify a dependency in both `devDependencies` _and_ `peerDependencies` (meaning, it's a peer dependency, but when I'm working on developing the package, I also want it to be installed), then it should not be bundled.

But, this is not the behavior I am seeing. Instead, the dependency is bundled into the build, unless I explicitly add it to `externals`. Is this intentional, or a bug? If it's intentional, maybe the README can be clarified to avoid such confusion?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the case with a package.json that lists the same dependency in both devDependencies and peerDependencies, then compare the result with the README statement that peerDependencies are excluded. Check how tsup determines which imports to bundle and whether the behavior or documentation matches the stated expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.