tinybundle

2.0.0 · active · verified Tue Apr 21

tinybundle is a minimalist command-line module bundler, currently at version 2.0.0, designed for simple bundling tasks without the complexity of modern bundlers like Webpack or Rollup. It distinguishes itself by eschewing a JavaScript API, relying solely on CLI arguments and a `tbdeps.json` configuration file. This file specifies a list of npm packages and local JavaScript files (prefixed with `!`), optionally allowing for pre-processing commands (prefixed with `?`) to be executed via `system` calls before bundling. The tool does not support traditional loaders, opting instead for this external command execution model. Its release cadence is not specified, but it targets users looking for an extremely lightweight, no-frills bundling solution where custom pre-processing can be scripted externally. It consolidates dependencies and local code into a single, minified output file.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates bundling a third-party npm package (jQuery) and a local JavaScript file into a single output file using the tinybundle CLI and `tbdeps.json` configuration. The output bundle's content is then displayed.

mkdir my-bundle-project
cd my-bundle-project
npm init -y
npm install jquery
echo '["jquery", "!index.js"]' > tbdeps.json
echo 'console.log("Hello from index.js!");' > index.js
npx tinybundle ./dist/bundle.js
cat ./dist/bundle.js

view raw JSON →