@zuke/tsdown
`@zuke/tsdown` — a typed `TsdownTasks` wrapper for the
@zuke/tsdown on JSR ↗ 5 symbols
Symbols
class TsdownBuildSettings extends ToolSettings Settings for a tsdown bundle run (tsdown [entries] [flags]).
| Member | Signature | Doc |
|---|---|---|
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). |
type TsdownFormat = esm | cjs | iife | umd An output format accepted by tsdown's --format.
class TsdownMigrateSettings extends ToolSettings Settings for a tsdown migrate run (tsdown migrate [flags]).
| Member | Signature | Doc |
|---|---|---|
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). |
const TsdownTasks: TsdownTasksApi Typed task functions for the tsdown bundler.
interface TsdownTasksApi The shape of TsdownTasks.
| Member | Signature | Doc |
|---|---|---|
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. |