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

Make `swc` configurable #1128

Open KevinGruber opened 1 month ago

KevinGruber commented 1 month ago

Hi,

Currently there is no way to configure swc. SWC is being used under the hood instead of rebuild when experimentalDecorators are being used.

Because of a weird behaviour in SWC we need to set the loose attribute so that it removes an undefined class property from the compiled output.

Currently I don't see any possibility to provide/change the swc config. https://github.com/egoist/tsup/blob/00188a0dc848c48fac45de245d1e021f370a84a3/src/esbuild/swc.ts#L31

Maybe I am just overlooking something. It should reconfigurable to be a valid option to be used IMO.

BR, Kev

Upvote & Fund

Fund with Polar