@zuke/tsdown

← API reference

`@zuke/tsdown` — a typed `TsdownTasks` wrapper for the

Symbols

# TsdownBuildSettings class
class TsdownBuildSettings extends ToolSettings

Settings for a tsdown bundle run (tsdown [entries] [flags]).

MemberSignatureDoc
entry entry(...paths: PathLike[]): this Entry point(s) to bundle (positional); repeatable.
format format(...formats: TsdownFormat[]): this Output format(s), joined into --format (e.g. esm,cjs).
dts dts(): this Emit TypeScript declaration files (--dts).
minify minify(): this Minify the output (--minify).
sourcemap sourcemap(): this Emit source maps (--sourcemap).
clean clean(): this Clean the output directory before building (--clean).
watch watch(): this Rebuild on change (--watch).
outDir outDir(path: PathLike): this Output directory (--out-dir).
target target(value: string): this Compilation target, e.g. es2022 or node18 (--target).
tsconfig tsconfig(path: PathLike): this Path to a tsconfig file (--tsconfig).
config config(path: PathLike): this Path to a tsdown config file (--config).
platform platform(value: string): this Target platform, e.g. node, browser, or neutral (--platform).
treeshake treeshake(): this Enable tree-shaking of the output (--treeshake).
# TsdownFormat type
type TsdownFormat = esm | cjs | iife | umd

An output format accepted by tsdown's --format.

# TsdownMigrateSettings class
class TsdownMigrateSettings extends ToolSettings

Settings for a tsdown migrate run (tsdown migrate [flags]).

MemberSignatureDoc
from from(value: string): this The tool to migrate from, e.g. tsup (--from).
dryRun dryRun(): this Preview the migration without writing any files (--dry-run).
# TsdownTasks const
const TsdownTasks: TsdownTasksApi

Typed task functions for the tsdown bundler.

# TsdownTasksApi interface
interface TsdownTasksApi

The shape of TsdownTasks.

MemberSignatureDoc
build build(configure?: Configure<TsdownBuildSettings>): Promise<CommandOutput> Bundle the entry points: tsdown.
migrate migrate(configure?: Configure<TsdownMigrateSettings>): Promise<CommandOutput> Migrate an existing project to tsdown: tsdown migrate.