Registry / web-framework / herb-build

herb-build

JSON →
library1.4.8jsnpmunverified

herb-build is a build tool for JavaScript/TypeScript projects with a focus on simplicity and convention over configuration. As of version 1.4.8 (stable, released monthly), it provides a single-command build pipeline that handles TypeScript compilation, bundling, and minification. Unlike Webpack or Rollup, herb-build aims to be zero-config for standard projects while still offering extensibility via plugins. It supports both ESM and CJS output, includes built-in type checking, and is designed for both CLI and programmatic use. The package has TypeScript definitions bundled and is available on npm, targeting Node.js environments.

npm install herb-build
INSTALL
IMPORT
SIG · HERB-BUILD
H
herb-build
web-frameworkjavascriptv1.4.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

build
import { build } from 'herb-build'
const build = require('herb-build')
herb-build is ESM-only; CommonJS require() is not supported.
createConfig
import { createConfig } from 'herb-build'
import createConfig from 'herb-build'
createConfig is a named export, not a default export.
defineConfig
import { defineConfig } from 'herb-build'
import { defineConfig } from 'herb-build/config'
defineConfig is exported from the main package, not a submodule.

Demonstrates basic usage of the build function with TypeScript input, ESM output, minification, and type declaration generation.

// Build script for modern JS/TS projects import { build } from 'herb-build'; // Minimal config: no options needed for defaults const result = await build({ input: 'src/index.ts', output: 'dist', format: 'esm', minify: true, types: true, }); console.log('Build completed:', result.output);
herb-build --version
Debug
Known issues
breakingIn v1.4.0, the 'format' option was changed from a string to an array of formats. Specifying a single string no longer works.
fix
Update format to an array, e.g., format: ['esm'] (or ['cjs']), or omit to use defaults.
affects: >=1.4.0
dangerIn v1.2.0, the 'sourcemap' default changed from 'inline' to 'external'. This may expose source code in production if external maps are deployed.
fix
Set sourcemap: 'inline' for production if you need to avoid external files, or ensure .map files are not served publicly.
affects: >=1.2.0
gotchaTypeScript declarations are only generated if the 'types' option is true (default false). Set to true to emit .d.ts files.
fix
Include types: true in the build options.
affects: *
gotchaThe built output will contain CommonJS wrapper unless format explicitly includes 'esm'. Default format is ['cjs'] which may not be tree-shakeable by bundlers.
fix
Specify format: ['esm'] for modern bundlers or format: ['cjs', 'esm'] for dual output.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'herb-build'
Package not installed or import path incorrect; herb-build is not a global install.
fix
Run 'npm install herb-build --save-dev' and ensure import/require uses correct path.
TypeError: build is not a function
Default import used instead of named import. herb-build exports named 'build', not default.
fix
Use import { build } from 'herb-build' instead of import build from 'herb-build'.
Error: Unknown option 'format'. Did you mean 'formats'?
Option was renamed in v1.4.0 from 'format' to 'formats' (or becomes array).
fix
Use 'formats' (plural) with an array value, e.g., formats: ['esm'].
Upgrade
Version history
1.4.8latest on npm
Audit
Dependencies
typescriptrequiredrequired for TypeScript compilation; must be installed in the project
rolluprequiredused internally for bundling; no direct import needed by user
Agent activity
6 hits · last 30 days
node
6
Resources