Skip to content

When unbundle and cjs format, JSON file had imported by ESM which was lost export #7804

@Gehbt

Description

@Gehbt

Reproduction link or steps

reproduction

stackblitz

https://stackblitz.com/github/Gehbt/250107-tsdown-bug-repo

github

https://github.com/Gehbt/250107-tsdown-bug-repo

steps

  1. run pnpm run build
  2. run pnpm run start

Output have Assertion fail.

What is expected?

run npm run node.start, there were no Assertion fail.

What is actually happening?

dist/data.js has no export syntax. So that undefined be imported

Any additional comments?

On bundle mode or format esm is fine.

Metadata

Metadata

Labels

bugSomething isn't workingtsdown

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions