egoist/tsup

Incorrect output of CJS exports with explicit string names #1077

quantizor posted onGitHub

Example reproduction: https://replit.com/@probablyup/tsup-repro

I went deep and tested this in esbuild and rollup, I believe the odd behavior is coming from tsup.

Steps:

  1. Fork the repro
  2. Click Run
  3. Go to dist/input.cjs.js

You'll see this output at the bottom which is invalid:

exports."design-system" = design_system;

It should be:

exports["design-system"] = design_system;

Additional replications:

<!-- POLAR PLEDGE BADGE START -->

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/egoist/tsup/issues/1077"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/egoist/tsup/issues/1077/pledge.svg?darkmode=1"> <img alt="Fund with Polar" src="https://polar.sh/api/github/egoist/tsup/issues/1077/pledge.svg"> </picture> </a> <!-- POLAR PLEDGE BADGE END -->


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests