Skip to Content
Octopus Energy Packages

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
RequirementVersion
Node.js≥24.0.0
Peer dependencyVersionWhen
tsdown>=0.22.14Required
@pandacss/dev^1.0.0Using the panda preset
@vitejs/plugin-react^6.1.0Using the react preset (React Compiler)
oxc-transform-react>=0.145.0Using the react preset (React Compiler)
publint>=0.3.0Using the validate preset
unplugin-unused>=0.5.0Using the validate preset

Add a build config

tsdown.config.ts
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.

tsdown.config.ts
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.

On this page