Post

What's the benefit of doing this versus just running tsc? Is that effectively what it's doing or does it still call rolldown under the hood?

That’s right—it’s still built on Rolldown, so you can take advantage of Rolldown plugins, inline dependencies, tree-shaking, clean dist, and more.

Which means today, unbundle is exactly the same as running tsc? We just call rolldown instead of tsc to give us opportunity to run plugins

If you don’t need the extra features tsdown offers(like shims or dual formats...) then tsdown essentially just transpiles TypeScript. By the way, tsdown also automatically adds file extensions (e.g., `.js`) to import statements.

Makes sense to me 👍 Shipping esm - use TSC Shipping dual - use tsdown Shipping esm & want build plugins - use tsdown

Additionally, tsdown is faster than tsc. For example, in the tsdown repository: - tsdown: 354.54ms - tsc: 834.87ms For larger projects, this performance gap will be even more significant.

For now, I think tsgo will solve that. Since we're comparing a native build to a js based build. It makes more sense to compare tsgo to tsdown But I think that's fine, we don't need a bundler when we're shipping straight up esm. Everywhere else i can see us using tsdown

It largely depends on your needs—both in terms of features and speed.

0 reposts0 likes

I think so. If I need to ship esm as-is, I can use tsgo. Don't really need to touch a bundler And in all other cases I think it'd be nice to consolidate around using tsdown