tsup README

The project's README from github.com/egoist/tsup. As one markdown file: README.md.

[!WARNING] This project is not actively maintained anymore. Please consider using tsdown instead. Read more in the migration guide.

tsup

npm version npm downloads

Bundle your TypeScript library with no config, powered by esbuild.

๐Ÿ‘€ What can it bundle?

Anything that's supported by Node.js natively, namely .js, .json, .mjs. And TypeScript .ts, .tsx. CSS support is experimental.

โš™๏ธ Install

Install it locally in your project folder:

npm i tsup -D
# Or Yarn
yarn add tsup --dev
# Or pnpm
pnpm add tsup -D

You can also install it globally but it's not recommended.

๐Ÿ“– Usage

Bundle files

tsup [...files]

Files are written into ./dist.

You can bundle multiple files in one go:

tsup src/index.ts src/cli.ts

This will output dist/index.js and dist/cli.js.

๐Ÿ“š Documentation

For complete usages, please dive into the docs.

For all configuration options, please see the API docs.

๐Ÿ’ฌ Discussions

Head over to the discussions to share your ideas.

Sponsors

Ship UIs faster with automated workflows for Storybook

sponsors

Project Stats

Alt

License

MIT ยฉ EGOIST

tsup (egoist/tsup)

Searching Databaseโ€ฆ

11.3K ยทGitHub
What is this?tsup is a zero-config bundler for TypeScript libraries, built on top of esbuild for speed.
Is this a CLI tool or a library I import?It is a command-line tool you run in your project; it compiles .js, .json, .mjs, .ts and .tsx files into a dist folder.
How do I get it running?Install tsup locally in your project folder and run it against your entry file(s); output goes to ./dist. You can bundle multiple entry files in one command.
What do I need to run it?Node.js 18 or newer is required; under the hood tsup relies on esbuild and rollup for bundling.
Is tsup still actively maintained?No. The maintainer has stopped active development and recommends switching to tsdown instead.
Can tsup bundle CSS files?Yes, but CSS support is explicitly called out as experimental in the README.
What should I use now that tsup is unmaintained?The README points users to tsdown as the recommended successor, with a migration guide linked.
Can I install tsup globally instead of per-project?You can, but the README advises against it and recommends a local project install instead.
What problem does tsup solve compared to configuring esbuild manually?It wraps esbuild with sensible defaults so you can bundle a TypeScript library with no configuration file needed.
What are similar projects?pkg, rollup, esbuild, tools, truffle, rolldown, nexe, snowpack
Creator
egoist
Size
2.2 MB
Stars
11.3K
Age
6y
Commits ยท 90 Days