egoist / egoist/tsup

Insonsistent handling of the "browser" field

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

Description

I have this in my package.json:

```
"browser": {
"./persistence.js": "./persistence-browser.js"
},
```

when I use `tsup --platform browser` it uses the browser version of the js, as it should. but with `--dts` it gets the types for the non-browser version.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown package.json browser mapping, comparing tsup --platform browser with the generated declarations from --dts. Trace how the browser field is resolved for bundling versus declaration generation; done means the declaration types use the browser version consistently.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.