optionalDependencies should be excluded by default
- 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
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