egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.48k stars 209 forks source link

Incorrect output of CJS exports with explicit string names #1077

Open quantizor opened 5 months ago

quantizor commented 5 months ago

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:

Upvote & Fund

Fund with Polar