egoist / egoist/tsup

optionalDependencies should be excluded by default

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

Description

By default tsup bundles all imported modules but `dependencies` and `peerDependencies` in `package.json` are always excluded.

I believe that `optionalDependencies` should be also excluded by default, as they are essentially the `dependencies` which are simply allowed to not exist, and the library author is supposed to import them dynamically and handle failed imports gracefully.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named in the issue. Start at tsup’s dependency-externalization entry point and compare the existing handling of dependencies and peerDependencies; done means optionalDependencies are excluded by default, with explicit bundling behavior preserved and tests covering the default.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.