yaup
raw JSON → 1.8.0 verified Fri May 01 auth: no javascript
A minimal, unopinionated CLI wrapper around esbuild for building dual CJS/ESM packages with TypeScript declaration files. Current stable version is 1.8.0, maintained by egoist. It offers a simple config file (yaup.config.ts) with defineConfig, supporting multiple output formats (esm, cjs, dts). Unlike opinionated alternatives like tsup or rollup, yaup stays close to raw esbuild, giving users flexible configuration with minimal API surface. Release cadence is irregular; the author is not accepting new features unless critical.
Common errors
error Error: Cannot find module 'esbuild' ↓
cause esbuild is a peer dependency not installed automatically
fix
npm install esbuild --save-dev
error Error: Config file not found: yaup.config.ts ↓
cause Config file must be in the root of the project or specified with --config
fix
Place yaup.config.ts in project root or use
yaup --config /path/to/config error TypeError: defineConfig is not a function ↓
cause Using CommonJS require() instead of ESM import
fix
Change to
import { defineConfig } from 'yaup' and ensure package.json has "type": "module" Warnings
breaking Dropped Node.js <12 support in v1.6.0 ↓
fix Upgrade yaup to >=1.6.0 or use Node.js >=12
deprecated format: 'types' renamed to 'dts' in v1.3.0 ↓
fix Use 'dts' instead of 'types' in output format
gotcha Config file must be named yaup.config.ts or yaup.config.js; other names are ignored ↓
fix Rename config file to yaup.config.ts or yaup.config.js
gotcha The input path must be relative to config file location, not cwd ↓
fix Use paths relative to the config file or absolute paths
Install
npm install yaup yarn add yaup pnpm add yaup Imports
- defineConfig wrong
const defineConfig = require('yaup').defineConfigcorrectimport { defineConfig } from 'yaup' - startDevServer wrong
const startDevServer = require('yaup').startDevServercorrectimport { startDevServer } from 'yaup' - build wrong
const yaup = require('yaup'); yaup.build()correctimport { build } from 'yaup'
Quickstart
// yaup.config.ts
import { defineConfig } from 'yaup'
export default defineConfig({
input: './src/index.ts',
output: [
{ format: 'esm', dir: 'dist/esm' },
{ format: 'cjs', dir: 'dist/cjs' },
{ format: 'dts', dir: 'dist/types' },
],
})