Registry / devops / bundt
library1.1.5jsnpmunverified

Bundt is a minimalistic JavaScript module bundler designed for simplicity and focused on efficient module processing. As of version 1.1.5, it provides core bundling capabilities suitable for libraries and smaller applications, emphasizing a straightforward API rather than extensive configuration. It maintains an active release cadence, with recent patches addressing minor bugs and edge cases related to import/export rewriting. Its primary differentiator is its lightweight nature, offering a less opinionated alternative to larger bundlers like Webpack or Rollup, particularly for scenarios where complex build pipelines are not required. It aims to deliver modules without excessive overhead or configuration.

npm install bundt
INSTALL
IMPORT
SIG · BUNDT
B
bundt
devopsjavascriptv1.1.5
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.

bundt
import { bundt } from 'bundt';
const bundt = require('bundt');
Bundt is primarily designed for modern Node.js environments and ESM. While Node.js >=6 is stated, programmatic usage is typically via ESM imports.
Options
import type { Options } from 'bundt';
For TypeScript users, import the `Options` interface to type the configuration object passed to the `bundt` function.
bundt (async)
await bundt({ entry: '...', output: '...' });
The `bundt` function is asynchronous and returns a Promise, which should be `await`ed or handled with `.then()`/`.catch()`.

Demonstrates how to programmatically use Bundt to bundle a JavaScript entry file into an output bundle, specifying format and sourcemap options.

import { bundt } from 'bundt'; import * as path from 'path'; import * as fs from 'fs/promises'; async function buildMyProject() { const entryFile = path.resolve('./src/index.js'); const outputDir = path.resolve('./dist'); const outFile = path.join(outputDir, 'bundle.js'); try { // Ensure the output directory exists await fs.mkdir(outputDir, { recursive: true }); await bundt({ entry: entryFile, output: outFile, format: 'esm', // or 'cjs', 'iife' sourcemap: true, // Example option for sourcemap generation // Additional options like 'treeshake', 'minify' could be added here }); console.log(`✅ Successfully bundled ${entryFile} to ${outFile}`); } catch (error) { console.error('❌ Bundling failed:', error); process.exit(1); } } buildMyProject();
Debug
Known issues
breakingVersion 1.1.3 introduced changes to how `import` and `export` statements are rewritten, particularly concerning statements within strings or template literals. This could lead to different bundling behavior or errors if relying on previous parsing quirks.
fix
Review code for `import` or `export` statements embedded in string literals or template literals. Ensure they conform to expected module syntax and are not being unintentionally rewritten.
affects: >=1.1.3
gotchaBundt is described as a 'simple' bundler. It may lack advanced features, such as extensive plugin ecosystems, highly configurable code splitting, or deep integration with various framework-specific tools, common in larger bundlers like Webpack or Rollup. Users coming from these tools might find limitations for complex build requirements.
fix
For complex projects requiring advanced optimizations, extensive plugin support, or specific framework integrations, consider evaluating more feature-rich bundlers. For simpler libraries or applications, Bundt's minimalistic approach can be advantageous.
affects: *
gotchaWhile Bundt supports different module `format` options ('esm', 'cjs', 'iife'), ensure your input modules and target environment's expectations align. Mismatched module types (e.g., ESM input targeting a pure CJS output without proper transpilation) can lead to runtime errors or unexpected behavior.
fix
Explicitly set the `format` option to match your target environment. If mixing CJS and ESM, verify Bundt's behavior or pre-process modules to a consistent format if issues arise.
affects: *
Errors
Common errors & fixes
Error: Cannot resolve './my-module.js' from 'path/to/entry.js'
The bundler could not locate a referenced module due to an incorrect path or missing file.
fix
Verify the module path is correct relative to the importing file or specified in `entry` option. Ensure the file actually exists on the filesystem.
SyntaxError: Unexpected token 'export' (or 'import')
This usually indicates that ESM syntax (like `export` or `import`) is being parsed in an environment that only supports CommonJS, or the bundler's output format is incorrect.
fix
Ensure your Node.js environment supports ESM if you're directly running bundled ESM code. If using Bundt, check the `format` option in your configuration; set it to 'cjs' if targeting a CommonJS environment.
TypeError: bundt is not a function
The `bundt` function was not imported correctly, or the module context is incorrect (e.g., trying to `require` an ESM-only package in a pure CJS file).
fix
Use `import { bundt } from 'bundt';` for modern Node.js environments. Ensure your file is treated as an ESM module (e.g., `.mjs` extension or `"type": "module"` in `package.json`).
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
bundt — npm install bundt · libregistry