zuke.tools.tsdown

← Python API reference

@zuke/tsdown 1.0.1: @zuke/tsdown — a typed TsdownTasks wrapper for the [tsdown](https://tsdown.dev) bundler, for use in Zuke builds.

Symbols

#

TsdownBuildSettings

class
class TsdownBuildSettings(ToolSettings)

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

  • entry(*paths: str) -> Self

    Entry point(s) to bundle (positional); repeatable.

  • format(*formats: Literal['esm', 'cjs', 'iife', 'umd']) -> Self

    Output format(s), joined into --format (e.g. esm,cjs).

  • dts() -> Self

    Emit TypeScript declaration files (--dts).

  • minify() -> Self

    Minify the output (--minify).

  • sourcemap() -> Self

    Emit source maps (--sourcemap).

  • clean() -> Self

    Clean the output directory before building (--clean).

  • watch() -> Self

    Rebuild on change (--watch).

  • out_dir(path: str) -> Self

    Output directory (--out-dir).

  • target(value: str) -> Self

    Compilation target, e.g. es2022 or node18 (--target).

  • tsconfig(path: str) -> Self

    Path to a tsconfig file (--tsconfig).

  • config(path: str) -> Self

    Path to a tsdown config file (--config).

  • platform(value: str) -> Self

    Target platform, e.g. node, browser, or neutral (--platform).

  • treeshake() -> Self

    Enable tree-shaking of the output (--treeshake).

#

TsdownMigrateSettings

class
class TsdownMigrateSettings(ToolSettings)

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

  • from_(value: str) -> Self

    The tool to migrate from, e.g. tsup (--from).

  • dry_run() -> Self

    Preview the migration without writing any files (--dry-run).

#

TsdownTasks

class
class TsdownTasks

Typed task functions for the tsdown bundler.

  • static async build(ctx: ServiceContext, configure: Callable[[TsdownBuildSettings], TsdownBuildSettings] | None=None) -> ExecResult

    Bundle the entry points: tsdown.

  • static async migrate(ctx: ServiceContext, configure: Callable[[TsdownMigrateSettings], TsdownMigrateSettings] | None=None) -> ExecResult

    Migrate an existing project to tsdown: tsdown migrate.