{"id":27861,"library":"herb-build","title":"herb-build","description":"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.","status":"active","version":"1.4.8","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install herb-build","lang":"bash","label":"npm"},{"cmd":"yarn add herb-build","lang":"bash","label":"yarn"},{"cmd":"pnpm add herb-build","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required for TypeScript compilation; must be installed in the project","package":"typescript","optional":false},{"reason":"used internally for bundling; no direct import needed by user","package":"rollup","optional":false}],"imports":[{"note":"herb-build is ESM-only; CommonJS require() is not supported.","wrong":"const build = require('herb-build')","symbol":"build","correct":"import { build } from 'herb-build'"},{"note":"createConfig is a named export, not a default export.","wrong":"import createConfig from 'herb-build'","symbol":"createConfig","correct":"import { createConfig } from 'herb-build'"},{"note":"defineConfig is exported from the main package, not a submodule.","wrong":"import { defineConfig } from 'herb-build/config'","symbol":"defineConfig","correct":"import { defineConfig } from 'herb-build'"}],"quickstart":{"code":"// Build script for modern JS/TS projects\nimport { build } from 'herb-build';\n\n// Minimal config: no options needed for defaults\nconst result = await build({\n  input: 'src/index.ts',\n  output: 'dist',\n  format: 'esm',\n  minify: true,\n  types: true,\n});\n\nconsole.log('Build completed:', result.output);","lang":"typescript","description":"Demonstrates basic usage of the build function with TypeScript input, ESM output, minification, and type declaration generation."},"warnings":[{"fix":"Update format to an array, e.g., format: ['esm'] (or ['cjs']), or omit to use defaults.","message":"In v1.4.0, the 'format' option was changed from a string to an array of formats. Specifying a single string no longer works.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Set sourcemap: 'inline' for production if you need to avoid external files, or ensure .map files are not served publicly.","message":"In v1.2.0, the 'sourcemap' default changed from 'inline' to 'external'. This may expose source code in production if external maps are deployed.","severity":"danger","affected_versions":">=1.2.0"},{"fix":"Include types: true in the build options.","message":"TypeScript declarations are only generated if the 'types' option is true (default false). Set to true to emit .d.ts files.","severity":"gotcha","affected_versions":"*"},{"fix":"Specify format: ['esm'] for modern bundlers or format: ['cjs', 'esm'] for dual output.","message":"The built output will contain CommonJS wrapper unless format explicitly includes 'esm'. Default format is ['cjs'] which may not be tree-shakeable by bundlers.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'npm install herb-build --save-dev' and ensure import/require uses correct path.","cause":"Package not installed or import path incorrect; herb-build is not a global install.","error":"Error: Cannot find module 'herb-build'"},{"fix":"Use import { build } from 'herb-build' instead of import build from 'herb-build'.","cause":"Default import used instead of named import. herb-build exports named 'build', not default.","error":"TypeError: build is not a function"},{"fix":"Use 'formats' (plural) with an array value, e.g., formats: ['esm'].","cause":"Option was renamed in v1.4.0 from 'format' to 'formats' (or becomes array).","error":"Error: Unknown option 'format'. Did you mean 'formats'?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}