egoist / tsup

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

TSUP seems to be ignoring the `minify: false` and `splitting: false` options in some cases #1093

Open maxpatiiuk opened 3 months ago

maxpatiiuk commented 3 months ago

TSUP seems to be ignoring the minify: false and splitting: false options in some cases

Description of the issue: https://github.com/maxpatiiuk/tsup-config-reproduction?tab=readme-ov-file#bugs

Minimal reproducible code: https://github.com/maxpatiiuk/tsup-config-reproduction?tab=readme-ov-file#replication

Upvote & Fund

Fund with Polar

maxpatiiuk commented 3 months ago

To clarify, the chunk splitting is causing issues in my application because it causes TypeScript to include import(somePath).SomeType statements in my .d.ts files when I export a type that's coming from a tsup-built library. But somePath is a TSUP's dynamically generated chunk file, and so not covered by my package.json's "exports" field, and thus not resolvable. My workaround was to add "./*": "./dist/*", in my package.json's exports, but that pretty much defeats the isolation benefits of the "exports" field