egoist / egoist/tsup

CommonJS exports warning

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

I'm getting this warning when using tsup:

`Entry module "index.cjs" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "index.cjs" to use named exports only.`

Tsup does not have the config option "output.exports" this warning asks me to define, how do I prevent this warning?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing tsup's configuration and documentation for CommonJS output, using the reported warning as the reproduction case. Determine whether tsup exposes an equivalent setting for output exports; the work is done when the warning can be prevented through documented tsup configuration or the limitation is clearly documented.

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
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.