egoist / tsup

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

Consider not following symlinks during `clean` #1149

Open 43081j opened 5 days ago

43081j commented 5 days ago

When clean: true, we basically glob **/* with our cwd set to dist.

If for whatever reason you have a symlink inside your dist directory, we currently follow it and remove whatever is on the other end.

In particular, anyone moving from tshy to tsup will hit this as tshy creates symlinks to your project directory in dist/. this means the first time you build using tsup, after previously using tshy, tsup removes itself (as it removes node_modules and everything else).

we should probably just remove the link rather than following it

Upvote & Fund

Fund with Polar