npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jmlweb/tsup-config-base

v2.0.3

Published

Base tsup configuration for jmlweb projects with sensible defaults

Downloads

933

Readme

@jmlweb/tsup-config-base

npm version License: MIT Node.js tsup

[!WARNING] Deprecated and no longer maintained. tsup is maintenance-only and recommends tsdown. Use @jmlweb/tsdown-config-base: same helper API and published file names, with a migration guide.

Base tsup configuration for jmlweb projects, with sensible defaults for TypeScript libraries and CLIs.

✨ Features

  • 🎯 Sensible defaults: Pre-configured for TypeScript libraries
  • 📦 Dual format: CommonJS and ESM output by default
  • 📝 Declarations: .d.ts generation enabled
  • 🖥️ CLI preset: Shebang support
  • 🛠️ Fully typed: Exported option types

📦 Installation

npm install --save-dev @jmlweb/tsup-config-base tsup

🚀 Quick Start

Create tsup.config.ts in your project root:

import { createTsupConfig } from '@jmlweb/tsup-config-base';

export default createTsupConfig();

💡 Examples

External Dependencies

import { createTsupConfig } from '@jmlweb/tsup-config-base';

export default createTsupConfig({
  external: ['@jmlweb/eslint-config-base-js', '@eslint/js', 'eslint'],
});

Multiple Entries and Extra Options

import { createTsupConfig } from '@jmlweb/tsup-config-base';

export default createTsupConfig({
  entry: { index: 'src/index.ts', utils: 'src/utils/index.ts' },
  external: ['commander'],
  options: {
    minify: true,
    sourcemap: true,
  },
});

CLI Package

import { createTsupCliConfig } from '@jmlweb/tsup-config-base';

export default createTsupCliConfig();
// Output: dist/cli.js with a #!/usr/bin/env node shebang

CLI with Library API

import { createTsupCliConfig } from '@jmlweb/tsup-config-base';

export default createTsupCliConfig({
  entry: { cli: 'src/cli.ts', index: 'src/index.ts' },
  shebang: 'cli', // Only the cli entry gets a shebang
  external: ['commander'],
});

📋 Configuration Details

createTsupConfig(options?): Options

| Option | Type | Default | Description | | ---------- | ------------------------------------ | ------------------ | -------------------------------- | | entry | string[] \| Record<string, string> | ['src/index.ts'] | Entry point files | | format | ('cjs' \| 'esm' \| 'iife')[] | ['cjs', 'esm'] | Output formats | | dts | boolean | true | Generate declaration files | | clean | boolean | true | Clean output before build | | outDir | string | 'dist' | Output directory | | external | (string \| RegExp)[] | [] | Packages to exclude from bundle | | options | Partial<Options> | {} | Additional tsup options to merge |

createTsupCliConfig(options?): Options | Options[]

Same options, with format defaulting to ['esm'] and entry to { cli: 'src/cli.ts' }, plus:

| Option | Type | Default | Description | | --------- | ------------------------------- | ---------- | ------------------------------------------------- | | target | NodeTarget | 'node18' | Node.js target version | | shebang | boolean \| string \| string[] | true | Shebang on all entries (true) or the named ones |

Returns an array of configs when a selective shebang is used.

Exports

  • createTsupConfig, createTsupCliConfig - Helpers
  • BASE_DEFAULTS, CLI_DEFAULTS - Default values
  • TsupConfigOptions, TsupCliConfigOptions, EntryConfig, NodeTarget - Types
  • Options - Re-exported from tsup

🎯 When to Use

Do not use for new projects. Use @jmlweb/tsdown-config-base instead.

Only keep this package while you have not yet migrated an existing tsup-based build.

🔧 Extending the Configuration

import { createTsupConfig } from '@jmlweb/tsup-config-base';

export default createTsupConfig({
  format: ['esm'], // ESM only
  dts: false, // No type declarations
  outDir: 'build',
  external: ['vitest'], // Peer, workspace and optional dependencies
  options: {
    minify: true,
    splitting: true,
    target: 'es2022',
  },
});

📝 Usage with Scripts

{
  "scripts": {
    "build": "tsup",
    "clean": "rm -rf dist",
    "prepublishOnly": "npm run build"
  }
}
npm run build  # Build the package
npm run clean  # Clean build output

📋 Requirements

  • Node.js >= 22.12.0
  • tsup >= 8.0.0 (tsup 9 itself requires Node.js >= 22.18.0)

📦 Peer Dependencies

  • tsup (>=8.0.0)

🔗 Related Packages

🔄 Migration Guide

From 1.x to 2.0.0

Breaking: Node.js >= 22.12.0 is required (18 and 20 are end-of-life).

To @jmlweb/tsdown-config-base

Follow the migration guide.

See the Changelog for version history.

📄 License

MIT