egoist / egoist/tsup

`jsc.env` and `jsc.target` cannot be used together

Open
#972 7 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

See PR https://github.com/swc-project/swc/pull/7704

I set target to `es5`(tsup.config.ts) and then create a `.swcrc` file with follow configurations:
```json
{
"env": {
"targets": [
"edge >= 13",
"chrome >= 49",
]
}
}
```

When executing command `npx tsup`, it report an error:
```
Error: `jsc.env` and `jsc.target` cannot be used together
```

Since version `@swc/core@1.3.72`

Is there any workaround?

Contributor guide

Open the contributing guide

Research direction

Reproduce the report using the mentioned tsup.config.ts and .swcrc files, with target set to es5 and the supplied env targets, then run npx tsup. Trace where these settings are passed into the bundling entry point and compare the behavior introduced with @swc/core 1.3.72. Done means the configuration no longer fails unexpectedly or the supported workaround is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.