Skip to content
Back to blog

Create a TypeScript library with tsup

July 24, 2024

Create a TypeScript library with tsup

Key takeaways

This guide targets tsup, tsup npm, and tsup TypeScript searches with a practical library baseline.

  • >Configure tsup for the output formats your users need.
  • >Ship TypeScript declarations with the package.
  • >Prepare npm exports for Node, bundlers, and TypeScript consumers.

Quick FAQ

Why use tsup for a TypeScript library?

tsup keeps build configuration compact and uses esbuild to produce JavaScript outputs quickly.

Does tsup generate TypeScript types?

tsup can orchestrate declaration generation, but the dts option and package types field still need to be checked.

Book a call