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
这是什么?tsup 是一个面向 TypeScript 库的零配置打包工具,基于 esbuild 构建,速度很快。
这是命令行工具,还是我要导入的库?它是一个你在项目中运行的命令行工具;它会把 .js、.json、.mjs、.ts 和 .tsx 文件编译到 dist 文件夹中。
我该怎么让它运行起来?在项目文件夹中本地安装 tsup,并针对你的入口文件运行它;输出会放到 ./dist。你可以在一条命令中打包多个入口文件。
运行它需要什么?需要 Node.js 18 或更高版本;在底层,tsup 依赖 esbuild 和 rollup 来完成打包。
tsup 还在积极维护吗?不了。维护者已停止积极开发,并建议改用 tsdown。
tsup 能打包 CSS 文件吗?可以,但 README 明确将 CSS 支持标注为实验性功能。
tsup 已经不再维护,我应该改用什么?README 推荐 tsdown 作为继任者,并附有迁移指南链接。
我能全局安装 tsup,而不是每个项目单独安装吗?可以,但 README 不建议这样做,而是推荐在项目中本地安装。
与手动配置 esbuild 相比,tsup 解决了什么问题?它在 esbuild 之上封装了合理的默认配置,因此无需配置文件就能打包 TypeScript 库。
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