Getting Started
Shared tsdown presets for building TypeScript packages
@octopus-energy/tsdown provides composable tsdown presets for TypeScript libraries, command-line tools, embedded package documentation, React packages, and Panda CSS design system packages.
Install
npm i -D @octopus-energy/tsdown tsdown| Requirement | Version |
|---|---|
| Node.js | ≥24.0.0 |
| Peer dependency | Version | When |
|---|---|---|
tsdown | >=0.22.14 | Required |
@pandacss/dev | ^1.0.0 | Using the panda preset |
@vitejs/plugin-react | ^6.1.0 | Using the react preset (React Compiler) |
oxc-transform-react | >=0.145.0 | Using the react preset (React Compiler) |
publint | >=0.3.0 | Using the validate preset |
unplugin-unused | >=0.5.0 | Using the validate preset |
Add a build config
import { library, validate, withPresets } from "@octopus-energy/tsdown";
export default withPresets({
presets: [library(), validate()],
});Each preset contributes one configuration fragment. The current built-in presets configure separate concerns, so their order does not affect the result. Declaration order matters when custom presets configure the same option or contribute ordered values; the surrounding user configuration is always applied last.
Customize the configuration
Add any tsdown configuration option alongside presets. Your configuration is applied last, so it can extend or override preset defaults.
import { library, validate, withPresets } from "@octopus-energy/tsdown";
export default withPresets({
presets: [library(), validate()],
entry: ["src/index.ts", "src/cli.ts"],
minify: false,
});See Configuration for preset options and custom presets, or the API reference for exported functions.