tsup

Bundle TypeScript projects into ESM and CJS outputs with type declarations.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/gil00pita/lanify --skill tsup-gil00pita
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsup
Source: https://github.com/gil00pita/lanify/tree/main/.agents/skills/tsup
Command: npx skills add https://github.com/gil00pita/lanify --skill tsup-gil00pita

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

tsup provides zero-config bundling for TypeScript libraries, enabling fast, reliable builds without boilerplate.

Core Features & Use Cases

  • Dual output formats: generate both ESModule (esm) and CommonJS (cjs) bundles.
  • Type declarations: emit .d.ts files to simplify publishing and TypeScript consumption.
  • Speed & simplicity: leverages esbuild for rapid builds and minimal configuration.
  • Use Case: package a TypeScript library for npm with ready-to-use bundles and declarations.

Quick Start

Install tsup as a dev dependency and run npx tsup to bundle your library.

Frequently Asked Questions about tsup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I bundle TypeScript libraries into ESM and CJS formats?

To bundle TypeScript libraries into ESM and CJS formats, use a zero-config bundler leveraging esbuild. It generates dual-format outputs with type declarations, simplifying npm package publishing without manual configuration boilerplate.

What is the best way to generate .d.ts type declarations for a TypeScript package?

Generating .d.ts type declarations for a TypeScript package is handled by a bundler that emits declaration files alongside ESM and CJS outputs. This simplifies TypeScript consumption for downstream library users without separate tooling.

Can I configure sourcemap and minify options for TypeScript bundling?

Yes, you can configure sourcemap and minify options for TypeScript bundling. The configuration surface supports entry, format, dts, sourcemap, minify, clean, splitting, external, noExternal, esbuildPlugins, watch, and metafile options for varied build environments.

Does esbuild work with TypeScript CLI tools that need dual format shipping?

Yes, esbuild works with TypeScript CLI tools that need dual format shipping by providing rapid, reliable builds. It supports bundling projects into both ESM and CJS formats with type declarations for varied runtime environments.

Why use zero-config bundling for TypeScript npm packages?

Zero-config bundling for TypeScript npm packages eliminates boilerplate setup while ensuring fast, reliable builds. It leverages esbuild to output dual ESM and CJS formats with declarations, streamlining the packaging and publishing workflow.