37 GB
4,042,753 files
Updated about 1 month ago
Name
Size
src
tests
CHANGELOG.md1.83 kB
xet
README.md2.39 kB
xet
deno.json406 Bytes
xet
mod.ts507 Bytes
xet
README.md

@zuke/tsup

Typed tsup CLI task wrapper for Zuke builds — bundle TypeScript/JavaScript with formats, declarations, minification, and more.

import { TsupTasks } from "@zuke/tsup";

await TsupTasks.build((s) =>
  s.entry("src/index.ts").format("esm", "cjs").dts().minify().clean()
);

API

Full typed API — generated from deno doc
`@zuke/tsup` — a typed `TsupTasks` wrapper for the
tsup (https://tsup.egoist.dev) bundler, for use in Zuke builds.

```ts
import { TsupTasks } from "@zuke/tsup";

await TsupTasks.build((s) =>
  s.entry("src/index.ts").format("esm", "cjs").dts().minify().clean()
);
```
@module

const TsupTasks: TsupTasksApi
  Typed task functions for the `tsup` bundler.

class TsupBuildSettings extends ToolSettings
  Settings for a `tsup` bundle run.

  override protected defaultTool(): string
    The executable this settings object runs: `tsup`.
  override protected defaultResolution(): ToolResolution
    Resolve the binary from `node_modules/.bin` by default — tsup is an npm-distributed tool.
  entry(...paths: PathLike[]): this
    Entry point(s) to bundle (positional); repeatable.
  format(...formats: TsupFormat[]): this
    Output format(s), joined into `--format` (e.g. `esm,cjs`).
  dts(): this
    Emit TypeScript declaration files (`--dts`).
  minify(): this
    Minify the output (`--minify`).
  sourcemap(): this
    Emit source maps (`--sourcemap`).
  clean(): this
    Clean the output directory before building (`--clean`).
  watch(): this
    Rebuild on change (`--watch`).
  outDir(path: PathLike): this
    Output directory (`--out-dir`).
  target(value: string): this
    Compilation target, e.g. `es2022` or `node18` (`--target`).
  tsconfig(path: PathLike): this
    Path to a tsconfig file (`--tsconfig`).
  config(path: PathLike): this
    Path to a tsup config file (`--config`).
  override protected buildArgs(): string[]
    Assemble the `tsup <entries> <flags>` argv.

interface TsupTasksApi
  The shape of {@link TsupTasks}.

  build(configure?: Configure<TsupBuildSettings>): Promise<CommandOutput>
    Bundle the entry points: `tsup`.

type TsupFormat = "esm" | "cjs" | "iife"
  An output format accepted by tsup's `--format`.
Total size
37 GB
Files
4,042,753
Last updated
Oct 24
Pre-warmed CDN
US EU US EU

Contributors