Registry / devops / bob-the-bundler

bob-the-bundler

JSON →
library7.0.1jsnpmunverified

Bob The Bundler is a TypeScript build and bundle tool designed primarily for monorepos, widely used by The Guild's open-source projects. Its current stable version is 7.0.1, with major releases introducing breaking changes, often around module systems and Node.js compatibility. Key features include building ESM and CommonJS compatible npm packages, verifying module imports for usability, and enabling incremental builds for performance in monorepo setups. It supports pnpm workspaces and offers configurable TypeScript `tsconfig` paths. Bob emphasizes a strict, convention-based approach to bundling, providing a robust solution for complex JavaScript/TypeScript projects that require precise control over build outputs and types.

npm install bob-the-bundler
INSTALL
IMPORT
SIG · BOB-THE-BUNDLER
B
bob-the-bundler
devopsjavascriptv7.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

build
import { build } from 'bob-the-bundler';
const { build } = require('bob-the-bundler');
Bob The Bundler transitioned to ESM-only since v5.0.0. CommonJS `require()` is not supported for programmatic imports.
watch
import { watch } from 'bob-the-bundler';
Used for setting up watch mode during development. ESM-only import.
createConfig
import { createConfig } from 'bob-the-bundler';
Helper function for programmatically creating Bob configuration objects. ESM-only import.

Demonstrates programmatic usage of Bob The Bundler to build a TypeScript project, including common configuration options like entry points, output formats, and `tsconfig` path. It also hints at typical CLI usage.

import { build } from 'bob-the-bundler'; import path from 'node:path'; const projectRoot = process.cwd(); // Example: Programmatically building a project async function runBuild() { try { console.log('Starting Bob build...'); await build({ cwd: projectRoot, // You can specify an array of entry points or glob patterns entry: ['src/index.ts', 'src/utils/**/*.ts'], // Define output formats (e.g., esm, cjs) format: ['esm', 'cjs'], // Specify the output directory outDir: 'dist', // Use 'tsconfig.build.json' by default, or fallback to 'tsconfig.json' tsconfig: path.join(projectRoot, 'tsconfig.build.json'), // Example of enabling watch mode (for a dev server scenario) // watch: false, // Add more configuration as needed based on your project structure // For example, splitting chunks, defining externals, etc. }); console.log('Bob build completed successfully!'); } catch (error) { console.error('Bob build failed:', error); process.exit(1); } } runBuild(); // CLI usage example (typically in package.json scripts): // { // "scripts": { // "build": "bob build", // "watch": "bob watch" // } // }
bob --version
Debug
Known issues
breakingThe `bob runify` command has been removed in v7.0.0. Projects using this command must migrate to alternative build or script runners.
fix
Remove `bob runify` from your build scripts and adopt alternative tools or custom scripts for your specific task.
affects: >=7.0.0
breakingBob The Bundler now requires Node.js version 16 or higher due to updates and reliance on modern JavaScript features.
fix
Upgrade your Node.js environment to version 16 or newer. Verify `engines.node` in your `package.json`.
affects: >=7.0.0
breakingSince v5.0.0, Bob The Bundler is bundled as an ES Module (ESM). Programmatic usage must now use `import` statements; `require()` for importing the library itself will result in an `ERR_REQUIRE_ESM` error.
fix
Migrate programmatic imports from `const pkg = require('bob-the-bundler');` to `import * as pkg from 'bob-the-bundler';` or named imports like `import { build } from 'bob-the-bundler';`.
affects: >=5.0.0
breakingVersion 4.0.0 introduced a breaking change to the `package.json` exports map, requiring `.d.ts` type declarations for CommonJS `require` entries to be changed to `.d.cts`.
fix
Update your `package.json` exports map. For `require` entries, change `"types": "./dist/typings/index.d.ts"` to `"types": "./dist/typings/index.d.cts"`.
affects: >=4.0.0
gotchaBeginning with v6.0.0, Bob The Bundler's build command prioritizes `tsconfig.build.json` as the default TypeScript configuration file, falling back to `tsconfig.json` if not found.
fix
Ensure your build-specific TypeScript configuration is either in `tsconfig.build.json` or explicitly specified via a configuration option if you wish to use a different file.
affects: >=6.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported.
Attempting to use CommonJS `require()` to import `bob-the-bundler` programmatically in Node.js versions >=5.0.0.
fix
Change your import statement to use ES Modules syntax: `import { build } from 'bob-the-bundler';`.
Error: `bob runify` is not a bob command. Did you mean `bob build`?
`bob runify` command was removed in v7.0.0.
fix
Update your `package.json` scripts or build automation to remove calls to `bob runify`. Consider replacing it with `bob build` or a custom script.
The current Node.js version (vX.Y.Z) is not supported. Please upgrade to Node.js >=16.
Running Bob The Bundler on a Node.js version older than 16.
fix
Upgrade your Node.js environment to version 16 or higher.
Error: Cannot find module 'typescript' or similar TypeScript compilation errors.
`typescript` is a peer dependency and must be explicitly installed in your project.
fix
Install TypeScript in your project: `npm install typescript` or `pnpm add typescript`.
TS2307: Cannot find module 'bob-the-bundler/dist/typings/index.d.ts' or its corresponding type declarations.
Incorrect TypeScript declaration path in `package.json`'s `exports` for `require` types (affected by v4.0.0 breaking change).
fix
If your `package.json` `exports` map specifies `require` for types, ensure it uses `.d.cts` for the declaration file, e.g., `"types": "./dist/typings/index.d.cts"`.
Upgrade
Version history
7.0.1latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency for type checking and compilation during the build process.
Agent activity
4 hits · last 30 days
node
4
Resources
bob-the-bundler — npm install bob-the-bundler · libregistry